Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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)

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

This discussion is preserved as it was. New answers, comments, and votes are closed.