Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How and why cash GUI script is not working and cant spot the error please help me, please?

Asked by 7 years ago
Edited 7 years ago

game.Players:WaitForChild(game.Players.LocalPlayer.Name):WaitForChild("leaderstats"):WaitForChild("Cash").Changed:connect(function() script.Parent.Text = game.Players:WaitForChild(game.Players.LocalPlayer.Name)WaitForChild("leaderstats"):WaitForChild("Cash").Value end)

0
sorry for not enough space to write the script well and please help me spot the error please urnices 2 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

I think it is like this:

while true do
    Wait(0.1)
    script.Parent.Text == game.Players.LocalPlayer:WaitForChild("leaderstats"   ):WaitForChild("stat name")
end
Ad
Log in to vote
0
Answered by 7 years ago

Here is a little more complex version.

local Plr = game.Players.LocalPlayer --The Player
local Stats = Plr.leaderstats --The leaderstats
while Stats ~= nil do -- While Stats Is in the game
wait()
script.Parent.Text = "Cash: "..Stats.Cash.Value.."$"
end

Answer this question