I'm trying to automatically update a nametag so each player's tag shows their corresponding values. The issue is that when it updates the value, only you can see your value change, and everyone else has, "Loading..." above them. The reason why only you can see your name change is that I was using a Local Script. I tried using a Script thinking this would solve the problem, but you can't get the local player in a Script.
UpdateText Script
local player = game.Players.LocalPlayer local statsFolder = player:WaitForChild("Leaderstats", 100) local rank = statsFolder:WaitForChild("Rank") local text = script.Parent text.Text = "Rank "..rank.Value rank.Changed:Connect(function() text.Text = "Rank "..rank.Value end)
I tried wrapping it around a game.Players.PlayerAdded Function,
game.Players.PlayerAdded:Connect(function(player) local statsFolder = player:WaitForChild("Leaderstats", 100) local rank = statsFolder:WaitForChild("Rank") local text = script.Parent text.Text = "Rank "..rank.Value rank.Changed:Connect(function() text.Text = "Rank "..rank.Value end) end)
But this didn't work...
Please help!
dude... you can get the local player. first, read this. then, try these two.
localscript:
local remote = ReplicatedStorage.RemoteEvent remote:FireServer(“whaddup”)
serverscript:
remote.OnServerEvent:Connect(function(player, message) print(player.Name, “says”, message) end)
try it out and see what happens. on the receiving end of OnServerEvent, the server always gets the player as the first argument and then any other arguments that were fired.
and jeez what’s up with the views on this post