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

How Do I change the text of the TextLabel when the Win Value has reached a certain amount?

Hey Scripters!

So I want to make a like leaderboard where you get like your Wins. I have this script going on for that:

game.Players.PlayerAdded:Connect(function(plr)
	
	local stats = Instance.new("Folder",plr)
	stats.Name = "leaderstats"
	
	local wins = Instance.new("IntValue",stats)
	wins.Name = "Wins"
	wins.Value = 0
end)

But I want to make a script where you can see above a players head. Put it does not seem to work when I want to use Wins.Value :

local gui = game:GetService("ServerStorage"):FindFirstChild("BillboardGui"):Clone()   --Gets the child from the script, which would be the GUI you created
local textlabel = gui.TextLabel

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
	if player.Wins.Value >= 1 then
	textlabel.TextColor3 = Color3.fromRGB(125,125,125)
	textlabel.Text = "Newbie"
	gui.parent = character.Head
	end
	if player.Wins.Value >= 50 then
	textlabel.TextColor3 = Color3.fromRGB(11,155,215)
	textlabel.Text = "Starter"
	gui.Parent = character.Head
	elseif player.Wins.Value >= 100 then
	textlabel.TextColor3 = Color3.fromRGB(255,30,30)
	textlabel.Text = "Pro"
	gui.Parent = character.Head
	
		end
	end)
end)

Kind Regards!

2 comments

0

does it work if you use an == instead of >= ?

0

I think the script is fine but the player.Wins.Value is messed up

1 answer

✓ Accepted answer

You putted player.Wins.Value when it should be player.leaderstats.Wins.Value

2 comments

0

Double check next time ;)

0

Ah I see, As if I remember I tried that too, probably misspelled something. Well, Thank you!

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