Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local unathed = {}
- local pservice = game:GetService("Players")
- local deb = false
- local laser = script.Parent.Laser
- local start = script.Parent.LaserStart
- local ender = script.Parent.LaserEnd
- local hitbox = script.Parent.HitboxStart
- local TweenService = game:GetService("TweenService")
- local otherdoor = game.Workspace.EntranceGate.Door
- local otheropen = game.Workspace.EntranceGate.DoorOpened
- local oclose = game.Workspace.EntranceGate.DoorClosed
- hitbox.Touched:Connect(function(p)
- if p.Parent and p.Parent:FindFirstChild("Humanoid") then
- if deb == false then
- deb = true
- p.Parent.Humanoid.WalkSpeed = 0
- p.Parent.Humanoid.JumpPower = 0
- p.Parent.HumanoidRootPart.CFrame = CFrame.new(script.Parent.cframe.Position, game.Workspace.EntranceGate.Door.Position)
- local tweenInfo = TweenInfo.new(
- 2, -- Time
- Enum.EasingStyle.Linear, -- EasingStyle
- Enum.EasingDirection.Out, -- EasingDirection
- 4, -- RepeatCount (when less than zero the tween will loop indefinitely)
- true, -- Reverses (tween will reverse once reaching it's goal)
- 0 -- DelayTime
- )
- local tweenInfo2 = TweenInfo.new(
- 5, -- Time
- Enum.EasingStyle.Linear, -- EasingStyle
- Enum.EasingDirection.Out, -- EasingDirection
- 0, -- RepeatCount (when less than zero the tween will loop indefinitely)
- false, -- Reverses (tween will reverse once reaching it's goal)
- 0 -- DelayTime
- )
- local tween = TweenService:Create(laser, tweenInfo, {CFrame = ender.CFrame})
- local tweeng1 = TweenService:Create(otherdoor, tweenInfo2, {CFrame = otheropen.CFrame})
- local tweeng2 = TweenService:Create(otherdoor, tweenInfo2, {CFrame = oclose.CFrame})
- laser.Transparency = 0.5
- tween:Play()
- wait(4)
- tween:Cancel()
- p.Parent.Humanoid.WalkSpeed = 16
- p.Parent.Humanoid.JumpPower = 50
- laser.Transparency = 1
- if table.find(unathed, pservice:GetUserIdFromNameAsync(p.Parent.Name)) then return end
- tweeng1:Play()
- wait(10)
- tweeng2:Play()
- wait(3)
- deb = false
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement