local player = game.Players.LocalPlayer
local cash = player.leaderstats.Cash
while true do
wait()
script.Parent.Text = "Cash: "..cash.Value
end
Are there any mistakes or anything?
I put this script in the textlabel.
local player = game.Players.LocalPlayer
local cash = player.leaderstats.Cash
while true do
wait()
script.Parent.Text = "Cash: "..cash.Value
end
Are there any mistakes or anything?
I put this script in the textlabel.
Using a loop is really bad because I once used too many loops and it crashed. I have been taught the .Changed:connect:function() method.
Make sure this is a local script in the text label;
local player = game.Players.LocalPlayer
local cash = player:WaitForChild("leaderstats").cash
local textlabel = script.Parent
textlabel.Text = cash.Value --When player joins they need to see their cash
cash.Changed:connect(function(Value) --FUNCTIONS WHEN CASH IS CHANGED
textlabel.Text = cash.Value
end)
If any other help is needed comment down below. Please upvote and accept answer if helped.
Thanks alot :) It works.
np
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
try putting brackets like this: script.Parent.Text = ( "Cash: "..cash.Value)