The script is about a textLabel that shows the level of the local player without it ("it" is the Level) being an IntValue on the Leaderboard.
local textLabel = script.Parent local Level = ("Level").Name local XP = ("XP").Name local Humanoid = script.Parent.Parent.Parent.Parent.Parent.Human Level.Value = 0 XP.Value = 0 function KillForXP() XP.Value = XP.Value + 100 wait(0.1) script:remove() end Humanoid.Died:connect(KillForXP) function XPforLevel Level.Value = Level.Value + 1 -- here the first Level is red underlined :(, help? if Level.Value + 1 then XP.Value = 0 end wait(0.1) script:remove end XP.Value = 1000:connect(XPforLevel) textLabel.Text = Level.Value -- the textLabel ( Parent )
Most of the problems are from syntax errors. For example, you forgot to add parentheses to the function at line 16. Read the errors that the "red lines" say and most of this should be fixed.
There are lots of syntax errors, stated by previous answers and comments. There is also a lot of deprecated code in your script. Big no no. Let me fix it up. Assuming your XP and Level values are in a leaderstats:
local plr = game:GetService('Players').LocalPlayer local char = plr.Character or plr.CharacterAdded:Wait() local humanoid = char.Humanoid -- idk why you even put 50 script.Parent local label = script.Parent local leaderstats = plr:WaitForChild"leaderstats" local xp = leaderstats:WaitForChild"XP" local lvl = leaderstats:WaitForChild"Level" function killForXP() xp.Value = xp.Value + 100 wait(.1) script:Destroy() -- :Destroy() not :remove() end humanoid.Died:Connect(killForXP) -- :Connect not :connect function xpForLevel() -- forgot the brackets lvl.Value = lvl.Value + 1 xp.Value = 0 wait(.1) script:Destroy() end xp.Changed:Connect(xpForLevel) lvl.Changed:Connect(function() label.Text = "Level: "..lvl.Value end)