Once a player touches he or she is supposed to get XP. However it does not work
HELP!
script.Parent.Touched:connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") ~= nil then
local leaderstats = Hit.Parent:FindFirstChild("leaderstats")
if leaderstats ~= nil then
print("leaderstats found!")
local XP = leaderstats:FindFirstChild("XP")
if XP ~= nil then
print("XP FOUND!")
Hit.Parent.leaderstats.XP.Value = Hit.Parent.leaderstats.XP.Value +5
end
end
end
end)
