in my client.lua I have the player coordinates being sent to the server using
local x, y, z = table.unpack(GetEntityCoords(ped, true))
TriggerServerEvent('sendpos', x, y, z)
in the server.lua it’s recieved and stored using
RegisterServerEvent('sendpos')
AddEventHandler("sendpos", function(x, y, z)
local playercoords[source] = {
["x"] = x,
["y"] = y,
["z"] = z,
}
end)
can someone please tell me a better way to store these variables and/or how to latter call these variables in the server.lua? I’ve tried using playercoords[source].x and playercoords[source]["x"] but neither of those seem to be working.
?, sorry indra I’m a little rusty, been awhile since i’ve worked with lua, I’m trying to learn javascript, c#, and php at the same time so my mind is a little jumbled.