I made a script where when you click a part (First aid kit), it gives you +30 health. For some reason even when I have 100 health, I am able to still buy it. I only want when you have lower than 30 health you can buy it (that's so the players don't buy if they have full health).
script.Parent.ClickDetector.MouseClick:connect(function(Clicker)
Clicker = Clicker.Character
if Clicker.Humanoid.Health <= 100 then
Clicker.Humanoid.Health = Clicker.Humanoid.Health + 30
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:WaitForChild("Storage")
end
end
end)
