This script is supposed to show the amount of money they have from the leaderboard it does not work. Please help me.
while wait() do --makes it loop if (script.Parent.Parent.Parent.Parent.Name ~= "StarterGui") then local player = script.Parent.Parent.Parent.Parent.Parent if (player.Parent.Name == "Players") then if (player.Stats.Money ~= nil) then --change "Coins" to the secret leaderboard item script.Parent.Text = "" .. player.Stats.Money.Value.."$"--change "Coins" to the secret leaderboard item end end end end
Why not use a local Script, It makes it so much easier to work with the client!
local Player = game.Players.LocalPlayer local PlayerGui = Player:WaitForChild("leaderstats")-- This make sure the script wait for the leaderstats to be added before continue running the script so the script doesn't error in the future. while wait(1) do if Player.leaderstats.Money.Value ~= nil then--If Money Value isn't nil or 0 then continue. script.Parent.Text = Player.Name.. " 's Cash: "..Player.leaderstats.Money.Value--Change script.Parent to the Money's Value. end end
script.Parent.Text = player.Stats.Money.Value.."$" try useing this