so currently I have this code:
[CODE]util.AddNetworkString ( "TeleportPlayer" )
net.Receive ( "TeleportPlayer", function ( messageLength, ply )
newpos = ("815.968750, -1135.991089, -79.968750")
if (CLIENT) then
ply = LocalPlayer()
end
ply:SetPos(Vector( newpos ))
end )[/CODE]
When I attempt to use it however, it doesn't teleport me to the position I assigned, instead it teleports me to here:
[CODE]0.000000 0.000000 64.000000[/CODE]
Any idea why? (Sorry, I'm still pretty new to GLua.)
[code]
// No point in having it as a global
local newpos = Vector(815.968750, -1135.991089, -79.968750)
-- rest of code
ply:SetPos(newpos)
[/code]
[b]Edit:[/b]
If newpos never changes, you might aswell just add
[code]
local newpos = Vector(815.968750, -1135.991089, -79.968750)
[/code]
before anything else.
[QUOTE=stev_;48373080][code]
newpos = Vector(815.968750, -1135.991089, -79.968750)
-- rest of code
ply:SetPos(newpos)
[/code][/QUOTE]
Still does the same thing.
EDIT:
The second thing you posted worked lol, thanks!
Sorry, you need to Log In to post a reply to this thread.