Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

arithmetic on field 'Armor' (a userdata value) error?

Asked by
lomo0987 250 Moderation Voter
10 years ago

Error:

"attempt to perform arithmetic on field 'Armor' (a userdata value)" -- line 25 it also has a stack begin and a stack end?

I don't know why that like that.. and I was wondering why it was coming up. Here is the script for it

wait(10)
print("Starting!")

repeat wait()until game.Players.LocalPlayer
print("Found Player")

plr=game:service("Players").LocalPlayer
print("Player has been set")

repeat wait()until plr:FindFirstChild("leaderstats")
print("Found Leaderstats")

repeat wait()until plr.Character~=nil 
print("Player has been found")

ar=plr.leaderstats:FindFirstChild("Armor")
print("Found Armor")

pl=plr.Character:FindFirstChild("Humanoid")
print("Found Humanoid")

if ar~=nil then 
    print("Starting to change health")

    pl.MaxHealth=plr.leaderstats.Armor + 100
    print("MaxHealth has been changed!")

    pl.Health=pl.Character.MaxHealth
    print("Health has been changed!")

elseif not plr2~=nil or not plr:FindFirstChild("leaderstats")~=nil or not plr:FindFirstChild("leaderstats"):FindFirstChild("Armor")~=nil then
print("Humanoid does not exist")
end

Answer this question