Advertisement
Guest User

messfesgeg

a guest
Jan 1st, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.01 KB | None | 0 0
  1. local unathed = {}
  2.  
  3. local pservice = game:GetService("Players")
  4. local deb = false
  5. local laser = script.Parent.Laser
  6. local start = script.Parent.LaserStart
  7. local ender = script.Parent.LaserEnd
  8. local hitbox = script.Parent.HitboxStart
  9. local TweenService = game:GetService("TweenService")
  10.  
  11. local otherdoor = game.Workspace.EntranceGate.Door
  12. local otheropen = game.Workspace.EntranceGate.DoorOpened
  13. local oclose = game.Workspace.EntranceGate.DoorClosed
  14.  
  15. hitbox.Touched:Connect(function(p)
  16.     if p.Parent and p.Parent:FindFirstChild("Humanoid") then
  17.         if deb == false then
  18.             deb = true
  19.             p.Parent.Humanoid.WalkSpeed = 0
  20.             p.Parent.Humanoid.JumpPower = 0
  21.             p.Parent.HumanoidRootPart.CFrame = CFrame.new(script.Parent.cframe.Position, game.Workspace.EntranceGate.Door.Position)
  22.             local tweenInfo = TweenInfo.new(
  23.     2, -- Time
  24.     Enum.EasingStyle.Linear, -- EasingStyle
  25.     Enum.EasingDirection.Out, -- EasingDirection
  26.     4, -- RepeatCount (when less than zero the tween will loop indefinitely)
  27.     true, -- Reverses (tween will reverse once reaching it's goal)
  28.     0 -- DelayTime
  29. )
  30.             local tweenInfo2 = TweenInfo.new(
  31.     5, -- Time
  32.     Enum.EasingStyle.Linear, -- EasingStyle
  33.     Enum.EasingDirection.Out, -- EasingDirection
  34.     0, -- RepeatCount (when less than zero the tween will loop indefinitely)
  35.     false, -- Reverses (tween will reverse once reaching it's goal)
  36.     0 -- DelayTime
  37. )
  38.             local tween = TweenService:Create(laser, tweenInfo, {CFrame = ender.CFrame})
  39.             local tweeng1 = TweenService:Create(otherdoor, tweenInfo2, {CFrame = otheropen.CFrame})
  40.             local tweeng2 = TweenService:Create(otherdoor, tweenInfo2, {CFrame = oclose.CFrame})
  41.             laser.Transparency = 0.5
  42.             tween:Play()
  43.             wait(4)
  44.             tween:Cancel()
  45.             p.Parent.Humanoid.WalkSpeed = 16
  46.             p.Parent.Humanoid.JumpPower = 50
  47.             laser.Transparency = 1
  48.             if table.find(unathed, pservice:GetUserIdFromNameAsync(p.Parent.Name)) then return end
  49.             tweeng1:Play()
  50.             wait(10)
  51.             tweeng2:Play()
  52.             wait(3)
  53.             deb = false
  54.         end
  55.     end
  56. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement