Advertisement
Demonlord27

test

Aug 15th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.79 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83.  
  84.  
  85. local char = owner.Character
  86. local plr = owner
  87. local DespawnTime = 3
  88. local a = 1
  89.  
  90.  
  91. tool = Instance.new("Tool")
  92. tool.Parent = owner.Backpack
  93. tool.Name = "Teleport"
  94. tool.CanBeDropped = false
  95. tool.RequiresHandle = false
  96. tool.ManualActivationOnly = false
  97.  
  98.  
  99. tool.Activated:connect(function()
  100. if a == 1 then do
  101. a = 0
  102.  
  103.  
  104.  
  105.  
  106. owner.Character.Humanoid.JumpPower = 0
  107. owner.Character.Humanoid.WalkSpeed = 0
  108. owner.Character.HumanoidRootPart.Anchored = true
  109.  
  110.  
  111. local portal = Instance.new("Part")
  112. portal.Parent = game.Workspace
  113. portal.Transparency = 1
  114. portal.Anchored = true
  115. portal.Orientation = Vector3.new(5, -90, 0)
  116. portal.CanCollide = false
  117. portal.Size = Vector3.new(13.659, 0.439, 11.466)
  118. portal.Name = "Portal"
  119.  
  120. local portal2 = Instance.new("Part")
  121. portal2.Parent = game.Workspace
  122. portal2.Transparency = 1
  123. portal2.Anchored = true
  124. portal2.Orientation = Vector3.new(5, -90, 0)
  125. portal2.CanCollide = false
  126. portal2.Size = Vector3.new(13.659, 0.439, 11.466)
  127. portal2.Name = "Portal"
  128.  
  129. local decal1 = Instance.new("Decal")
  130. decal1.Parent = portal
  131. decal1.Face = "Top"
  132. decal1.Texture = "http://www.roblox.com/asset/?id=34042610"
  133. decal1.Color3 = Color3.new(255,255,225)
  134.  
  135. local decal2 = Instance.new("Decal")
  136. decal2.Parent = portal2
  137. decal2.Face = "Top"
  138. decal2.Texture = "http://www.roblox.com/asset/?id=34042610"
  139. decal2.Color3 = Color3.new(255,255,225)
  140.  
  141. local decal3 = Instance.new("Decal")
  142. decal3.Parent = portal
  143. decal3.Face = "Bottom"
  144. decal3.Texture = "http://www.roblox.com/asset/?id=34042610"
  145. decal3.Color3 = Color3.new(255,255,225)
  146.  
  147. local decal4 = Instance.new("Decal")
  148. decal4.Parent = portal2
  149. decal4.Face = "Bottom"
  150. decal4.Texture = "http://www.roblox.com/asset/?id=34042610"
  151. decal4.Color3 = Color3.new(255,255,225)
  152.  
  153.  
  154.  
  155.  
  156.  
  157. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -3.2, -0))
  158.  
  159. portal.CFrame = portal.CFrame*CFrame.new(0, 0.6, 0)
  160.  
  161. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 4, -0))
  162. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -3, -0))
  163.  
  164. wait(0.015)
  165.  
  166. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -2, -0))
  167. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 3, -0))
  168.  
  169. wait(0.015)
  170. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -1, -0))
  171. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 2, -0))
  172.  
  173. wait(0.015)
  174. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -0, -0))
  175.  
  176. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 1, -0))
  177.  
  178.  
  179. wait(0.015)
  180. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 1, -0))
  181.  
  182. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 0, -0))
  183.  
  184. wait(0.015)
  185. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 2, -0))
  186.  
  187. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -1, -0))
  188.  
  189. wait(0.015)
  190. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 2.9, -0))
  191.  
  192. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -2, -0))
  193.  
  194.  
  195. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -2.9, -0))
  196.  
  197.  
  198.  
  199. wait(0.015)
  200. char.Head.CFrame = CFrame.new(Mouse.Hit.x, Mouse.Hit.y + 4, Mouse.Hit.z)
  201.  
  202.  
  203. wait(0.015)
  204. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -2, -0))
  205.  
  206. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 2.9, -0))
  207.  
  208. wait(0.015)
  209. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -1, -0))
  210.  
  211. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 1.9, -0))
  212.  
  213. wait(0.015)
  214. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 0, -0))
  215.  
  216. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 0.9, -0))
  217.  
  218. wait(0.015)
  219. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 1, -0))
  220.  
  221. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -1.9, -0))
  222.  
  223. wait(0.015)
  224. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 2, -0))
  225.  
  226. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -2.9, -0))
  227.  
  228. wait(0.015)
  229. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 3, -0))
  230.  
  231. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -3, -0))
  232.  
  233. wait(0.015)
  234. portal2.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, 4, -0))
  235.  
  236. portal.CFrame = (plr.Character["Torso"].CFrame* CFrame.new(0, -4, -0))
  237.  
  238.  
  239. wait(0.2)
  240.  
  241. owner.Character.HumanoidRootPart.Anchored = false
  242. owner.Character.Humanoid.JumpPower = 60
  243. owner.Character.Humanoid.WalkSpeed = 18
  244.  
  245.  
  246. portal:Remove()
  247. portal2:Remove()
  248.  
  249. a = 1
  250.  
  251.  
  252.  
  253.  
  254.  
  255. end end end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement