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

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

Asked by 5 years ago
Edited 5 years ago

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!

0
does it work if you use an == instead of >= ? retracee 68 — 5y
0
I think the script is fine but the player.Wins.Value is messed up maup12345 20 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

0
Double check next time ;) SirDerpyHerp 262 — 5y
0
Ah I see, As if I remember I tried that too, probably misspelled something. Well, Thank you! maup12345 20 — 5y
Ad

Answer this question