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

How to make this increase a GUI number?

Asked by 10 years ago

In my game, I am trying to make an advanced Scoring system. Whenever your score goes up, a number on the screen will go up as well. I was wanting to know if it's possible to change GUI text.

GUI is like this in the explorer: Scores Score Frame Text

local Humanoid = script.Parent.Humanoid
function PwntX_X() 
local tag = Humanoid:findFirstChild("creator") 
    if tag ~= nil then 
        if tag.Value ~= nil then 
local Leaderstats = tag.Value:findFirstChild("leaderstats") 
            if Leaderstats ~= nil then 
Leaderstats.Score.Value = Leaderstats.Score.Value + 100
wait(0.1)
script:remove()
            end 
        end 
    end 
end 
Humanoid.Died:connect(PwntX_X) 

1 answer

Log in to vote
0
Answered by
wazap 100
10 years ago
local Humanoid = script.Parent.Humanoid
function PwntX_X() 
local tag = Humanoid:findFirstChild("creator") 
    if tag and tag.Value then
local Leaderstats = tag.Value:findFirstChild("leaderstats") 
            if Leaderstats then 
Leaderstats.Score.Value = Leaderstats.Score.Value + 100
workspace.Score.Scores.Frame.Text = Leaderstats.Score.Value
wait(0.1)
script:Destroy()
            end 
        end 

end 
Humanoid.Died:connect(PwntX_X) 

btw this script needs a lot of work

Ad

Answer this question