Advertisement
seasee54u

Untitled

Apr 28th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.70 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. local plr = owner
  84. local deb = false
  85.  
  86. while not plr.Character do wait() end
  87. wait(0.1)
  88.  
  89. warn("Timestop loaded. R to toggle time.")
  90.  
  91. local tstab = {}
  92. local tsstab = {}
  93. local ignlist = {}
  94. local stab = {}
  95.  
  96. function plrIgnore(char)
  97. for i,v in pairs(char:GetChildren()) do
  98. if #v:GetChildren() >= 1 then
  99. plrIgnore(v)
  100. end
  101. table.insert(ignlist,v)
  102. end
  103. end
  104.  
  105. function timeStop(target)
  106. for i,v in pairs(target:GetChildren()) do
  107. if #v:GetChildren() >= 1 then
  108. timeStop(v)
  109. end
  110. local isinign = false
  111. for i,b in pairs(ignlist) do
  112. if b == v then
  113. isinign = true
  114. end
  115. end
  116. if isinign == false then
  117. if v:IsA("Part") or v:IsA("WedgePart") or v:IsA("UnionOperation") then
  118. if v.Anchored == false then
  119. table.insert(tstab,v)
  120. v.Anchored = true
  121. end
  122. end
  123. if v:IsA("Sound") then
  124. local isintab = false
  125. for i,b in pairs(stab) do
  126. if v == b[1] then
  127. isintab = true
  128. end
  129. end
  130. if isintab == false then
  131. table.insert(stab,{v,v.Pitch})
  132. end
  133. end
  134. --[[if v:IsA("Script") or v:IsA("LocalScript") then
  135. if v.Disabled == false then
  136. table.insert(tsstab,v)
  137. v.Disabled = true
  138. end
  139. end]]
  140. end
  141. end
  142. local isinign = false
  143. for i,b in pairs(ignlist) do
  144. if b == target then
  145. isinign = true
  146. end
  147. end
  148. if isinign == false then
  149. if target:IsA("Part") or target:IsA("WedgePart") or target:IsA("UnionOperation") then
  150. if target.Anchored == false then
  151. table.insert(tstab,target)
  152. target.Anchored = true
  153. end
  154. end
  155. if target:IsA("Sound") then
  156. table.insert(stab,{target,target.Pitch})
  157. end
  158. end
  159. end
  160.  
  161. plr:GetMouse().KeyDown:connect(function(key)
  162. if key == "r" then
  163. if deb == true then
  164. deb = false
  165. else
  166. deb = true
  167. local cc = Instance.new("ColorCorrectionEffect",game:GetService("Lighting"))
  168. spawn(function()
  169. plr.Character.Humanoid.WalkSpeed = 0
  170. plr.Character.Humanoid.JumpPower = 0
  171. local p = Instance.new("Part",plr.Character)
  172. p.Transparency = 0.5
  173. p.BrickColor = BrickColor.new("Institutional white")
  174. p.Size = Vector3.new(0.2,0.2,0.2)
  175. p.Anchored = true
  176. p.CanCollide = false
  177. p.CFrame = plr.Character.Torso.CFrame
  178. local m = Instance.new("SpecialMesh",p)
  179. m.MeshType = Enum.MeshType.Sphere
  180.  
  181. local r = 255
  182. local g = 255
  183. local b = 255
  184. local contrast = 0
  185.  
  186. for i=1,50 do
  187. m.Scale = m.Scale + Vector3.new(50,50,50)
  188. p.Transparency = p.Transparency + 0.5/50
  189. r = r - ((255-42)/50)
  190. g = g - ((255-0)/50)
  191. b = b - ((255-255)/50)
  192. contrast = contrast - 2/50
  193. --cc.TintColor = Color3.fromRGB(r,g,b)
  194. cc.Contrast = contrast
  195. for i,v in pairs(stab) do
  196. v[1].Pitch = v[1].Pitch - (v[2]/50)
  197. end
  198. wait()
  199. end
  200. p:Destroy()
  201. plr.Character.Humanoid.WalkSpeed = 16
  202. plr.Character.Humanoid.JumpPower = 50
  203. end)
  204.  
  205. local aNew = game:GetService("Workspace").ChildAdded:connect(function(c)
  206. timeStop(c)
  207. end)
  208.  
  209. for i,v in pairs(ignlist) do
  210. table.remove(ignlist,1)
  211. end
  212. plrIgnore(plr.Character)
  213. timeStop(game:GetService("Workspace"))
  214. while deb ~= false do wait() end
  215. --spawn(function()
  216. local r = 42
  217. local g = 0
  218. local b = 255
  219. local contrast = -2
  220. for i=1,50 do
  221. r = r + ((255-42)/50)
  222. g = g + ((255-0)/50)
  223. b = b + ((255-255)/50)
  224. contrast = contrast + 2/50
  225. --cc.TintColor = Color3.fromRGB(r,g,b)
  226. cc.Contrast = contrast
  227. for i,v in pairs(stab) do
  228. v[1].Pitch = v[1].Pitch + (v[2]/50)
  229. end
  230. wait()
  231. end
  232. cc:Destroy()
  233. --end)
  234. for i,v in pairs(tstab) do
  235. v.Anchored = false
  236. end
  237. for i,v in pairs(tstab) do
  238. table.remove(tstab,1)
  239. end
  240. --table.foreach(stab,print)
  241. for i,v in pairs(stab) do
  242. table.remove(stab,1)
  243. end
  244. --print("---------")
  245. --table.foreach(stab,print)
  246. --[[for i,v in pairs(tsstab) do
  247. v.Disabled = false
  248. end
  249. for i,v in pairs(tsstab) do
  250. table.remove(tsstab,1)
  251. end]]
  252. aNew:disconnect()
  253. deb = false
  254. end
  255. end
  256. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement