Hey guys I am making spawns points and it keeps saying that my table doesn't exist. What am I doing wrong?
myvector={}
myvector[1] = Vector(-5451.094238, -5368.163574, -255.968750)
myvector[2] = Vector(-5037.062012, -5113.559082, -255.968750)
myvector[3] = Vector(-5155.478027, -5616.186035, -255.968750)
if CUSTOM_SPAWN == true then
timer.Create('_spawnSetter', 1, 1, function()
ply:SetPos(myvector[1])
ply:ChatPrint('SPAWNED')
end )
end
myvector={}
myvector[1] = Vector(-5451.094238, -5368.163574, -255.968750)
myvector[2] = Vector(-5037.062012, -5113.559082, -255.968750)
myvector[3] = Vector(-5155.478027, -5616.186035, -255.968750)
This can be done like this:
myvector = {
Vector(-5451.094238, -5368.163574, -255.968750),
Vector(-5037.062012, -5113.559082, -255.968750),
Vector(-5155.478027, -5616.186035, -255.968750)
}
You can use timer.Simple instead of timer.Create with one repetition
You also want to localize your table, like so:
local myvector = { }
Thank you ! You guys help me solve it.
Sorry, you need to Log In to post a reply to this thread.