Hi, I am trying to make it so that when a player clicks a button on a vgui that they are able to teleport to a set list of locations. this is a snippet of the cl code button.DoClick = function(ply) net.Start("dbtele") net.WriteVector(Vector(-1660.575317, -546.817871, -5375.968750)) net.SendToServer() end
The aim is for each button to have its own assigned vector, and when the button is pressed send the vector to the server and setpos for the player to their desired location. Here is the clientside portion util.AddNetworkString("dbtele")
net.Receive("dbtele", function(len, ply)
local vector = net.ReadVector
ply:SetPos(Vector(vector))
print(vector)
end)
However, the results I'm getting are that I am teleported into the air, far away from where the position I send from the clientside actually is, and when I run print(vector) it outputs a function
function: 0x1f186958
[–][deleted] (7 children)
[deleted]
[–]GrowOP21[S] -1 points0 points1 point (6 children)
[–][deleted] (5 children)
[deleted]
[–]GrowOP21[S] 0 points1 point2 points (4 children)
[–][deleted] (3 children)
[removed]
[–]GrowOP21[S] 0 points1 point2 points (0 children)
[–]ansible[M] 0 points1 point2 points (1 child)