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

Changing overhead Gui through leaderstats?

Asked by
ABK2017 406 Moderation Voter
6 years ago

I'm not sure why this is proving so difficult, but I have a leaderstats script that works as well as an overhead gui script which works. I would like to change the overhead gui text, based on the leaderstat value of the player ie - a title/rank system. Could I not just add an "if" statement at line 3 that checks for the players leaderstats.Money.Value? Something that would end like Money.Value >= 2000 then...? Thanks. This has been my Achilles Heel lately.

game.Players.PlayerAdded:Connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)

        wait(1)
        local gui=Instance.new("BillboardGui")
        gui.Parent=newPlayer.Character.Head
        gui.Adornee=newPlayer.Character.Head
        gui.Size=UDim2.new(3,0,4,0) 
        gui.StudsOffset=Vector3.new(0,1,0)
        local name=Instance.new("TextLabel")
        name.Parent = gui
        name.BackgroundTransparency = 1
        name.Text = "Noob"  
        name.Size = UDim2.new(1,0,1,0)
        name.Position=UDim2.new(0,0,-0.41,0)
        name.TextColor3=Color3.new(255,255,255)
        name.FontSize = "Size18"
        end

function onPlayerEntered(newPlayer)
    newPlayer.Changed:Connect(function (property)
        if (property == "Character") then
            onPlayerRespawned(newPlayer)
        end
    end)
end

game.Players.PlayerAdded:Connect(onPlayerEntered)
0
You should be using local functions, and instead of changed simply wait for the character. User#19524 175 — 6y
0
Ok, I will change to CharacterAdded ABK2017 406 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

If you respond to my DMs, I can help you. (This reply contains a quick screenshot of what I've sent you)

https://imgur.com/a/U139632

Response will be edited with final solution.

Ad
Log in to vote
0
Answered by 6 years ago

If you respond to my DMs, I can help you. (This reply contains a quick screenshot of what I've sent you)

https://imgur.com/a/U139632

Response will be edited with final solution.

Answer this question