Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a regen button that dissapears when you step on it?

Asked by 3 years ago

How do I make a dissapearing regen button? You step on it and then it dissapears temporialy then it comes back. I want it to dissapear for 200 seconds. I don't know how to code.

1 answer

Log in to vote
0
Answered by
Punctist 120
3 years ago
Edited 3 years ago

Put a part inside workspace and then inside the part put in a script and insert this in it.

local healpart = script.Parent
local amount = 50

script.Parent.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid")
    if humanoid then
        humanoid.Health = humanoid.Health + amount
        healpart.Parent = game.ServerStorage
        wait(200)
        healpart.Parent = workspace
    end 
end)
Ad

Answer this question