Hi!
In my healing script, there is a part where you heal 25 times in quick succession gaining 1 health point each time. But whenever you deselect, sometimes it breaks, as the took goes back into the backpack, how could I fix this?
By the way this is where the script is located
StarterPack.MedKit.Script
for i = 1,25 do
if script.Parent.Parent.Humanoid.Health ~= 100 or script.Parent.Parent.Parent.Parent.Humanoid.Health ~= 100 then
Health:TakeDamage(-1)
print('Health added = ' , i )
wait(.1)
print("Hi")
end
end
end
i've also tried
if script.Parent.Parent.Humanoid.Health ~= 100 or script.Parent.Parent.Parent.Humanoid.Health ~= 100 then
All help obliged, thanks!

2 comments
Would the server script alternative be: local players = game:GetService("Players") // players.PlayerAdded:Connect(function(player) // local character = player.CharacterAdded:Wait() // end)
game:GetServiceis just used to get the Roblox Service Class, so it can be used anywhere... Object.EventName:Connect(f) is the syntax to listen for when an event Occurs on an object.. all event classes have a Wait() method which you can call to halt the code until that event fires.. so if i did game.Players.PlayerAdded:Wait() in a server script, it would halt the code until a player joins game