So what i'm trying to do is make it where you have to be a certain level to get the Experience/Money from the mob. This is going to prevent exploiters from grinding in high level areas because they have to be to a certain level to gain the Experience/Money.
local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:FindFirstChild("creator")
if tag ~= nil then
local Leaderstats = tag.Value:FindFirstChild("leaderstats")
local lvl = Leaderstats:FindFirstChild("Level")
if lvl == 15 then
if Leaderstats ~= nil then
Leaderstats.Experience.Value = Leaderstats.Experience.Value + 25
wait(0.1)
script:Remove()
end
end
end
end
end
Humanoid.Died:Connect(PwntX_X)
local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:FindFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:FindFirstChild("leaderstats")
local lvl = Leaderstats:FindFirstChild("Level")
if lvl == 15 then
if Leaderstats ~= nil then
Leaderstats.Money.Value = Leaderstats.Money.Value + 25
wait(0.1)
script:Remove()
end
end
end
end
end
Humanoid.Died:Connect(PwntX_X)

2 comments
You need to tell us what is going wrong with your script in order for us to help. Errors? Unexpected behavior?
No errors >_> Sorry for the late response.