This medkit won’t delete after usage. The uses value increasing works but for some reason it just won’t delete even if the value goes over. I’ve tried replacing the “>=” on the 4th to last line with “==” and it doesn’t work. I’m not sure why.
local ProximityPromptService = game:GetService("ProximityPromptService")
local ProximityPrompt = script.Parent
local Sound = script.Parent.Parent.Heal
local incrementValue = 20 --can be changed to any value depending upon how much health you want to increase
local Uses = script.Parent.Parent.Uses
ProximityPrompt.Triggered:Connect(function(player)
Sound:Play()
workspace[player.Name].Humanoid.Health = workspace[player.Name].Humanoid.Health + incrementValue
Uses.Value = Uses.Value + 1
print("Health increased")
end)
if Uses.Value >= 5 then
print("a")
script.Parent.Parent:Destroy()
end