Last active
July 1, 2022 01:32
-
-
Save dianjuar/80c877ca46a9006e6800d8426bcc2969 to your computer and use it in GitHub Desktop.
Roblox Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local platform = script.Parent | |
local isTouched = false | |
local function fade(fadeDuration: number, reaperance: number) | |
local fadeIntervals = 29 | |
local intervalFraction = fadeDuration / fadeIntervals | |
return function () | |
if not isTouched then | |
isTouched = true | |
for count = 1, fadeIntervals do | |
platform.Transparency = count / fadeIntervals | |
wait(intervalFraction) | |
end | |
platform.CanCollide = false | |
wait(reaperance) | |
platform.CanCollide = true | |
platform.Transparency = 0 | |
isTouched = false | |
end | |
end | |
end | |
platform.Touched:Connect(fade(3, 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onTouched(Obj) | |
local h = Obj.Parent:FindFirstChild("Humanoid") | |
if h then | |
h.Health = 0 | |
end | |
end | |
script.Parent.Touched:Connect(onTouched) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment