Tokio

[HELP] Why not working this roadblock script?

Recommended Posts

What wrong with this script?

Spoiler

rbs = {}
function del(source,command)
            for index, roadb in ipairs(rbs) do
                destroyElement(roadb)
            end
			exports.fly_box:showBox (source,"info","Útzárak sikeresen törölve lettek!")
end
addCommandHandler("rbdel",del)

function small(source,command)
local x,y,z = getElementPosition(source)
local rotX,rotY,rotZ = getElementRotation(source)
table.insert(rbs,  createObject(978,x,y,z-0.15,0,0,rotZ) )
setElementPosition ( source, x, y, z+1 )
exports.fly_box:showBox (source,"info","Útzár létrehozva!\nHasználat utáni törlése KÖTELEZŐ, /rbdel")
end
addCommandHandler("rb1",small)

function large(source,command)
local x,y,z = getElementPosition(source)
local rotX,rotY,rotZ = getElementRotation(source)
table.insert(rbs,  createObject(981,x,y,z,0,0,rotZ+180) )
setElementID ( roadblockobject, rbo )
setElementPosition ( source, x, y, z+1 )
exports.fly_box:showBox (source,"info","Útzár létrehozva!\nHasználat utáni törlése KÖTELEZŐ, /rbdel")
end
addCommandHandler("rb2",large)

function yellow(source,command)

            local x,y,z = getElementPosition(source)

            local rotX,rotY,rotZ = getElementRotation(source)

            table.insert(rbs,  createObject(3578,x,y,z-0.2,0,0,rotZ) )

	    setElementID ( roadblockobject, rbo )
            setElementPosition ( source, x, y, z+1 )

			exports.fly_box:showBox (source,"info","Útzár létrehozva!\nHasználat utáni törlése KÖTELEZŐ, /rbdel")

end

addCommandHandler("rb3",yellow)



function detour(source,command)

            local x,y,z = getElementPosition(source)

            local rotX,rotY,rotZ = getElementRotation(source)

            table.insert(rbs,  createObject(3091,x,y,z-0.38,0,0,rotZ+180) )

	    setElementID ( roadblockobject, rbo )
            setElementPosition ( source, x, y, z+1 )

			exports.fly_box:showBox (source,"info","Útzár létrehozva!\nHasználat utáni törlése KÖTELEZŐ, /rbdel")

end
addCommandHandler("rb4",detour)



function cone(source,command)

            local x,y,z = getElementPosition(source)

            local rotX,rotY,rotZ = getElementRotation(source)

            table.insert(rbs,  createObject(1238,x,y,z-0.65,0,0,rotZ) )

	    setElementID ( roadblockobject, rbo )
            setElementPosition ( source, x, y, z+1 )

			exports.fly_box:showBox (source,"info","Útzár létrehozva!\nHasználat utáni törlése KÖTELEZŐ, /rbdel")

end

addCommandHandler("rb5",cone)



function fence(source,command)

            local x,y,z = getElementPosition(source)

            local rotX,rotY,rotZ = getElementRotation(source)

            table.insert(rbs,  createObject(1459,x,y,z-0.4,0,0,rotZ) )

	    setElementID ( roadblockobject, rbo )
            setElementPosition ( source, x, y, z+1 )

			exports.fly_box:showBox (source,"info","Útzár létrehozva!\nHasználat utáni törlése KÖTELEZŐ, /rbdel")

end

addCommandHandler("rb6",fence)


function line(source,command)

            local x,y,z = getElementPosition(source)

            local rotX,rotY,rotZ = getElementRotation(source)

            table.insert(rbs,  createObject(2957,x,y,z-2.6,0,0,rotZ) )

	    setElementID ( roadblockobject, rbo )
            setElementPosition ( source, x, y, z+1 )

			exports.fly_box:showBox (source,"info","Útzár létrehozva!\nHasználat utáni törlése KÖTELEZŐ, /rbdel")

end

addCommandHandler("rb7",line)

setTimer(function()
for index, roadb in ipairs( rbs ) do
destroyElement( roadb )
end
end, 7200000, 0)

 

Error: script.lua:1: unexpected symbol near '?' 

How to fix this?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.