i have 2 RemoteEvents to change id inside the player and to teleport a player with the id
the problem is change event changes value only for player
how do i make the changes server-sided?
Change fire event server script
game.ReplicatedStorage.Changing.OnServerEvent:Connect(function(plr, id)
local tpvalue = plr:WaitForChild('ID')
tpvalue = id
wait(1)
print(tpvalue) --shows the right id
end)
teleport fire event server script
game.ReplicatedStorage.TPEvent.OnServerEvent:Connect(function(plr, Id)
local TeleportService = game:GetService("TeleportService")
local id = plr.ID.Value
print(id) -- shows me the wrong ID,
TeleportService:TeleportAsync(id, {plr})
end)