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

I need help with a leveling system and for some reason it doesn't work?

Asked by 2 years ago

Basically, I have a level for a certain person right like a value for their level and I want it in text form without getting rid of the level text

I tried this but it still doesn't work:


game.Players.PlayerAdded:Connect(function(player) local LevelLable = game,StarterGui.TopLeftGui.LevelGui.LevelLabel local Level = Instance.new("IntValue") Level.Name = "Level" Level.Parent = player Level.Value = 1 LevelLable.text = "level:".. Level.Value end)

2 answers

Log in to vote
1
Answered by
MattVSNNL 620 Moderation Voter
2 years ago

Hello, You are trying to set a Number to text which will error, so we use something called tostring which converts numbers to text. Also for your StarterGui you did a comma instead of a dot!

game:GetService("Players").PlayerAdded:Connect(function(player)
    local LevelLable = game.StarterGui.TopLeftGui.LevelGui.LevelLabel
    local Level = Instance.new("IntValue")

    Level.Name = "Level"
    Level.Parent = player  
    Level.Value = 1

    LevelLable.text = "level:"..tostring(Level.Value)
end)
Ad
Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

hey you! have you ever heard of enes? if you are in trouble, better call enes!

Answer this question