I have a teleporting system in my game, which works just fine in single player. But when I try it out in multiplayer any other person on the server gets the error: “includes/extensions/player.lua:147: attempt to call method ‘UniqueID’ (a nil value)”. whereas I am able to teleport around perfectly fine.
In my shared.lua I have this:
[lua]function Teleport_z(ply, command, args)
ply:SetPos(Vector(ply:GetPos().x, ply:GetPos().y, args))
local vPoint = ply:GetShootPos()
local effectdata = EffectData()
effectdata:SetStart( vPoint )
effectdata:SetOrigin( vPoint )
effectdata:SetScale( 1000 )
util.Effect( “BloodImpact”, effectdata )
util.Effect( “cball_explode”, effectdata )
util.Effect( “RPGShotDown”, effectdata)
Now the weird thing is that the effects stuff works perfectly fine, the sounds and effects show up exactly where they should be, but the character does not move to where the effects are, instead the other players gets the error mentioned earlier. This also happens when I try to use the ply:SetPData command as well, which is also in my shared.lua file. But whenever I try to set any player data etc. I just get that same error, well the other player on the server does.
I am still able to teleport perfectly fine without error though. I see no reason why this should not work, as well as use commands such as pl:PrintMessage.
Am I calling player wrong or anything, or is there a special way to call the player so you can set data?
I have tried searching all over the wiki and forums to find a solution to no avail.
Cheers in advance.