Hey bin gerade dabei scripten zu lernen und wollte euch mal fragen wo hier die Fehler sind. Viele hab ich selbst verbessern können aber manche eben nicht deshalb frage ich euch
Lua
local schranke1 = createObject(968, 1608, -1238.900390625, 48.799999237061, 0, 270, 175.99548339844)
local schranke2 = createObject(968, 1622, -1240.2998046875, 49, 0, 270, 351.99645996094)
local marker1 = createColSphere(1612.400390625, -1232.7001953125, 49.799999237061, 5)
local marker2 = createColSphere(1619.099609375, -1233.599609375, 49.799999237061, 5)
local wachhaus1 = createObject(967, 1607.2998046875, -1239, 48.099998474121, 0, 0, 83.995971679688)
local gatebar1 = createObject(966, 1608.099609375, -1238.900390625, 47.900001525879, 0, 0, 175.99548339844)
local gatebar2 = createObject(966, 1622, -1240.2998046875, 48.200000762939, 0, 0, 351.99645996094)
function MautIn (player)
if getElementType (player) == "vehicle" then
local Spielername = getPlayerName(player)
outputChatBox(Spielername..", Sie sind an der Mautstelle! Bitte halten sie an und zahlen 10$!", getRootElement(), 255, 255, 109)
end
end
addEventHandler("onColShapeHit", marker1, MautIn)
local PlayerVehicle = getPlayerOccupiedVehicle(player)
function FreezePlayer (player)
if getElementType(player) == "vehicle" then
local currentFreezeStatus = isElementFrozen (player)
local nowFreezeStatus = not currentFreezeStatus
setElementFrozen (playerVehicle, newFreezeStatus)
else outputChatBox("Du sitzt in keinem Fahrzeug", 255, 255, 109)
end
end
addEventHandler("onColShapeHit", marker1, FreezePlayer)
setTimer(FreezePlayer, 2000, 1)
function takeMoney (player, amount)
if getElementType(player) == "vehicle" then
takePlayerMoney(player, 10)
end
end
addEventHandler("onColShapeHit", marker1, takeMoney)
function MautOut (player)
if getElementType (player) == "vehicle" then
local Spielername = getPlayerName(player)
outputChatBox("Danke, Sie können nun weiterfahren!", 255, 255, 109)
end
end
function moveSchranke1 ()
if takePlayerMoney == true then
moveObject(schranke1, 2000, 1622, -1240.2998046875, 49, 0, 0, 351.99645996094)
end
end
Alles anzeigen