Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Keycard door:
- script.Parent.Touched:Connect(function(hit)
- if hit.Parent.Name == "Keycard" then
- script.Parent.CanCollide = false
- script.Parent.Transparency = 1
- wait(1)
- script.Parent.CanCollide = true
- script.Parent.Transparency = 0
- end
- end)
- Automatic sliding door:
- local TweenService = game:GetService("TweenService")
- local door1 = script.Parent:WaitForChild("Door1")
- local door2 = script.Parent:WaitForChild("Door2")
- local tweeningInformation = TweenInfo.new(
- 0.5,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local door1Open = {CFrame = CFrame.new(-4.23, 3.99, -8.56)}
- local door2Open = {CFrame = CFrame.new(-26.57, 3.99, -8.56)}
- local door1Close = {CFrame = CFrame.new(-11.57, 3.99, -8.56)}
- local door2Close = {CFrame = CFrame.new(-18.91, 3.99, -8.56)}
- local tween1open = TweenService:Create(door1,tweeningInformation,door1Open)
- local tween1close = TweenService:Create(door1,tweeningInformation,door1Close)
- local tween2open = TweenService:Create(door2,tweeningInformation,door2Open)
- local tween2close = TweenService:Create(door2,tweeningInformation,door2Close)
- script.Parent.Detector1.Touched:Connect(function(hit)
- tween1open:Play()
- tween2open:Play()
- wait(2)
- tween1close:Play()
- tween2close:Play()
- end)
- script.Parent.Detector2.Touched:Connect(function(hit)
- tween1open:Play()
- tween2open:Play()
- wait(2)
- tween1close:Play()
- tween2close:Play()
- end)
- Rotate:
- local uni = script.Parent
- while true do
- wait()
- uni.CFrame = uni.CFrame * CFrame.Angles(0,.1,0)
- end
- Color change:
- while true do
- script.Parent.Color = Color3.new(math.random(), math.random(), math.random())
- wait(0.5)
- end
- 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