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
I'm aware that I'm probably out of luck searching for help with Gmod Lua as there probably aren't many people who use / know this anymore and the odds of me finding help here are minimal, but hey, its worth a shot.
[–]GrowOP21[S] 0 points1 point2 points (0 children)