Skip to main content

Roblox script (Killing the player and fading platform)

 Final Code - Killing the Player:


  1. local lava = script.Parent
  2.  
  3. local function killPlayer(otherPart)
  4. local partParent = otherPart.Parent
  5. local humanoid = partParent:FindFirstChild("Humanoid")
  6. if humanoid then
  7. humanoid.Health = 0
  8. end
  9. end
  10.  
  11. lava.Touched:Connect(killPlayer)

 Final Code - Flading Platform:


  1. local platform = script.Parent
  2.  
  3. local isTouched = false
  4.  
  5. local function fade()
  6. if not isTouched then
  7. isTouched = true
  8. for count = 1, 10 do
  9. platform.Transparency = count / 10
  10. wait(0.1)
  11. end
  12. platform.CanCollide = false
  13. wait(3)
  14. platform.CanCollide = true
  15. platform.Transparency = 0
  16. isTouched = false
  17. end
  18. end
  19.  
  20. platform.Touched:Connect(fade)




Comments