I'm trying to make a sort of armor system and am just trying to test it out but it doesn't work. Basically, it adds a bool value to the player called "HasArmor" if its true its supposed to change the max health of the player to 150.
My problem is that I made a button to try and test this out but it isn't working and keeps giving me this error
Workspace.Button.ProximityPrompt.Script:3: attempt to index nil with 'FindFirstChild
Here is the code I have written
function givearmor()
if script.Parent.Triggered then
game.Players.LocalPlayer:FindFirstChild("HasArmor")
print("HasArmor was found!")
end
end
script.Parent.Triggered:Connect(givearmor)
