How can I identify "player" on XP.Changed function?
local Level = Instance.new("IntValue")
Level.Name = "Level"
Level.Value = 1
Level.Parent = stats
local XP = Instance.new("IntValue")
XP.Name = "XP"
XP.Value = 0
XP.Parent = stats
local XPN = Instance.new("IntValue")
XPN.Name = "XPN"
XPN.Value = 500
XPN.Parent = stats
local Gold = Instance.new("IntValue")
Gold.Name = "Gold"
Gold.Value = 0
Gold.Parent = stats
XP.Changed:connect(function()
if player:WaitForChild("XP").Value >= player:WaitForChild("XPN").Value then
Level.Value = Level.Value+1
XPN.Value = XPN.Value+500
end
end)
end)

2 comments
I did that but I didn't post that part, its still not working.
Ah sorry, I saw that instead of "(player)" it was using "(p)" so thats why it didnt work! Thank you very much for that answer.