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

How do i make a GUI show you leaderstats?

Asked by 5 years ago

Hello, im currently making a roblox obby, and i want to make a GUI showing what stage you are on

this is my leaderstat script and its currently located in workspace

function stagenr(object)

    local player = game.Players:playerFromCharacter(object)

    if player ~= nil then
        local a = player.leaderstats
        local b = game.Workspace:FindFirstChild(a.Stage.Value)

        object.Torso.CFrame = object.Torso.CFrame + Vector3.new(0,3,0)
        wait()
        object.Torso.CFrame = b.CFrame + Vector3.new(0,3,0)
    end

end

function stagenrr(object) if object.className == "Player" then

    local c = Instance.new("IntValue")

    c.Name = "leaderstats"

    local d = Instance.new("IntValue")

    d.Name = "Stage"
    d.Value = 0
    d.Parent = c
    c.Parent = object
end

end

game.Players.ChildAdded:Connect(stagenrr) game.Workspace.ChildAdded:Connect(stagenr)

0
On the first line the function isnt :playerFromCharacter it is :GetPlayerFromCharacter and if you have already made the folder and intvalue then you can access it from another script SuperSamyGamer 316 — 5y

Answer this question