Hello. I am working on a script that gives you a certain item once you get in between a certain XP value. It’s not even running the script. It only runs the script once I spawn it, then it stops. The script is a local script in a GUI under startergui.
Here is the code:
local clearance = 0
if plr.leaderstats.XP.Value >= 0 and plr.leaderstats.XP.Value <= 20 then
clearance = 1
eventClearance:FireServer(clearance)
print("Given level 1 clearance to " ..plr.Name)
elseif plr.leaderstats.XP.Value >= 21 and plr.leaderstats.XP.Value <= 60 then
clearance = 2
eventClearance:FireServer(clearance)
print("Given level 2 clearance to " ..plr.Name)
elseif plr.leaderstats.XP.Value >= 61 and plr.leaderstats.XP.Value <= 120 then
clearance = 3
eventClearance:FireServer(clearance)
print("Given level 3 clearance to " ..plr.Name)
elseif plr.leaderstats.XP.Value >= 121 and plr.leaderstats.XP.Value <= 300 then
clearance = 4
eventClearance:FireServer(clearance)
print("Given level 4 clearance to " ..plr.Name)
elseif plr.leaderstats.XP.Value >= 301 and plr.leaderstats.XP.Value <= 1500 then
clearance = 5
eventClearance:FireServer(clearance)
print("Given level 5 clearance to " ..plr.Name)
elseif plr.leaderstats.XP.Value >= 1501 and plr.leaderstats.XP.Value <= 5000 then
clearance = "onmi"
eventClearance:FireServer(clearance)
print("Given Omni clearance to " ..plr.Name)
end
end```