Advertisement
SomeKid

Some ROBLOX scripts of mine

Jul 26th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.82 KB | None | 0 0
  1.  
  2. Keycard door:
  3.  
  4. script.Parent.Touched:Connect(function(hit)
  5. if hit.Parent.Name == "Keycard" then
  6. script.Parent.CanCollide = false
  7. script.Parent.Transparency = 1
  8. wait(1)
  9. script.Parent.CanCollide = true
  10. script.Parent.Transparency = 0
  11. end
  12. end)
  13.  
  14.  
  15.  
  16. Automatic sliding door:
  17.  
  18. local TweenService = game:GetService("TweenService")
  19. local door1 = script.Parent:WaitForChild("Door1")
  20. local door2 = script.Parent:WaitForChild("Door2")
  21. local tweeningInformation = TweenInfo.new(
  22.     0.5,  
  23.     Enum.EasingStyle.Linear,
  24.     Enum.EasingDirection.Out,
  25.     0,
  26.     false,
  27.     0
  28. )
  29. local door1Open = {CFrame = CFrame.new(-4.23, 3.99, -8.56)}
  30. local door2Open = {CFrame = CFrame.new(-26.57, 3.99, -8.56)}
  31. local door1Close = {CFrame = CFrame.new(-11.57, 3.99, -8.56)}
  32. local door2Close = {CFrame = CFrame.new(-18.91, 3.99, -8.56)}
  33. local tween1open = TweenService:Create(door1,tweeningInformation,door1Open)
  34. local tween1close = TweenService:Create(door1,tweeningInformation,door1Close)
  35. local tween2open = TweenService:Create(door2,tweeningInformation,door2Open)
  36. local tween2close = TweenService:Create(door2,tweeningInformation,door2Close)
  37.  
  38. script.Parent.Detector1.Touched:Connect(function(hit)
  39.     tween1open:Play()
  40.     tween2open:Play()
  41.     wait(2)
  42.     tween1close:Play()
  43.     tween2close:Play()
  44. end)
  45. script.Parent.Detector2.Touched:Connect(function(hit)
  46.     tween1open:Play()
  47.     tween2open:Play()
  48.     wait(2)
  49.     tween1close:Play()
  50.     tween2close:Play()
  51. end)
  52.  
  53.  
  54.  
  55. Rotate:
  56.  
  57. local uni = script.Parent
  58.  
  59. while true do
  60.     wait()
  61.     uni.CFrame = uni.CFrame * CFrame.Angles(0,.1,0)
  62. end
  63.  
  64.  
  65.  
  66. Color change:
  67.  
  68. while true do
  69. script.Parent.Color = Color3.new(math.random(), math.random(), math.random())
  70. wait(0.5)
  71. end
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. These are some of the most generic scripts out there but I figured scripting newbies might need them.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement