InfMods

easy working disappearing and reappearing part script

Sep 24th, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. step 1: add a part
  2. step 2: add local script into the part
  3. step 3: copy and paste script
  4.  
  5.  
  6. enabled = 0
  7. val = 0
  8.  
  9. function onTouched(part)
  10.  
  11.  
  12.  
  13. local h = part.Parent:findFirstChild("Humanoid")
  14. if (h ~=nil) then
  15.  
  16. if (enabled == 0) then
  17. enabled = 1
  18. val = val+0.1
  19. script.Parent.Transparency = val
  20. script.Parent.CanCollide = true
  21. wait(.1)
  22. val = val+0.1
  23. script.Parent.Transparency = 0.1+val
  24. script.Parent.CanCollide = true
  25. wait(.1)
  26. val = val+0.1
  27. script.Parent.Transparency = 0.1+val
  28. script.Parent.CanCollide = true
  29. wait(.1)
  30. val = val+0.1
  31. script.Parent.Transparency = 0.1+val
  32. script.Parent.CanCollide = true
  33. wait(.1)
  34. val = val+0.1
  35. script.Parent.Transparency = 0.1+val
  36. script.Parent.CanCollide = true
  37. wait(.1)
  38. val = val+0.1
  39. script.Parent.Transparency = 0.1+val
  40. script.Parent.CanCollide = true
  41. wait(.1)
  42. val = val+0.1
  43. script.Parent.Transparency = 0.1+val
  44. script.Parent.CanCollide = true
  45. wait(.1)
  46. val = val+0.1
  47. script.Parent.Transparency = 0.1+val
  48. script.Parent.CanCollide = true
  49. wait(.1)
  50. val = val+0.1
  51. script.Parent.Transparency = 0.1+val
  52. script.Parent.CanCollide = true
  53. wait(.1)
  54. script.Parent.Transparency = 1
  55. script.Parent.CanCollide = false
  56. wait(2)
  57. val = 0
  58. enabled = 0
  59. script.Parent.Transparency = 0
  60. script.Parent.CanCollide = true
  61. end
  62. end
  63. end
  64.  
  65. script.Parent.Touched:connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment