I made this script where if you press on a part, you get +5 health. But I would like a if statement to be like, if the player has 100 health then he is not able to get it. Idk how to add that. Any help is appreciated.
script.Parent.ClickDetector.MouseClick:connect(function(Clicker)
Clicker = Clicker.Character
print(Clicker.Name.. " has recieved +5 health.")
Clicker.Humanoid.Health = Clicker.Humanoid.Health + 5
for i,v in pairs {script.Parent.Parent} do
local Storage = game:GetService("ServerStorage"):WaitForChild("MedKitsStorage")
v.Parent = Storage
wait(60)
v.Parent = game.Workspace
end
end)

1 comment
What's the point in using a
forloop to go over one thing?