Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

this script only eorks once and does not show the players money why?

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

2 comments

0

@duckyo011 I guess we can't help you because you clearly telling us not to mess with you code, "DON'T MESS WITH THIS!" ;)

0

Sorry that was for my friend sorry

2 answers

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.