sIendytubble

Zawarudo Script FE

Jun 14th, 2020 (edited)
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.05 KB | None | 0 0
  1.  
  2. -- zawarudo by sIendytubble on pastebin --
  3.  
  4. -- controls are simple
  5. -- use the tool to za warudo or un stop time
  6. -- it wont affect your player though
  7. -- basically the tool toggles za warudo
  8. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  9. local Player,game,owner = owner,game
  10. local RealPlayer = Player
  11. do
  12. print("FE Compatibility code by Mokiros")
  13. local rp = RealPlayer
  14. script.Parent = rp.Character
  15.  
  16. --RemoteEvent for communicating
  17. local Event = Instance.new("RemoteEvent")
  18. Event.Name = "UserInput_Event"
  19.  
  20. --Fake event to make stuff like Mouse.KeyDown work
  21. local function fakeEvent()
  22. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  23. t.connect = t.Connect
  24. return t
  25. end
  26.  
  27. --Creating fake input objects with fake variables
  28. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  29. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  30. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  31. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  32. end}
  33. --Merged 2 functions into one by checking amount of arguments
  34. CAS.UnbindAction = CAS.BindAction
  35.  
  36. --This function will trigger the events that have been :Connect()'ed
  37. local function te(self,ev,...)
  38. local t = m[ev]
  39. if t and t._fakeEvent then
  40. for _,f in pairs(t.Functions) do
  41. f(...)
  42. end
  43. end
  44. end
  45. m.TrigEvent = te
  46. UIS.TrigEvent = te
  47.  
  48. Event.OnServerEvent:Connect(function(plr,io)
  49. if plr~=rp then return end
  50. m.Target = io.Target
  51. m.Hit = io.Hit
  52. if not io.isMouse then
  53. local b = io.UserInputState == Enum.UserInputState.Begin
  54. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  55. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  56. end
  57. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  58. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  59. end
  60. for _,t in pairs(CAS.Actions) do
  61. for _,k in pairs(t.Keys) do
  62. if k==io.KeyCode then
  63. t.Function(t.Name,io.UserInputState,io)
  64. end
  65. end
  66. end
  67. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  68. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  69. end
  70. end)
  71. Event.Parent = NLS([==[
  72. local Player = game:GetService("Players").LocalPlayer
  73. local Event = script:WaitForChild("UserInput_Event")
  74. local Mouse = Player:GetMouse()
  75. local UIS = game:GetService("UserInputService")
  76. local input = function(io,a)
  77. if a then return end
  78. --Since InputObject is a client-side instance, we create and pass table instead
  79. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  80. end
  81. UIS.InputBegan:Connect(input)
  82. UIS.InputEnded:Connect(input)
  83. local h,t
  84. --Give the server mouse data 30 times every second, but only if the values changed
  85. --If player is not moving their mouse, client won't fire events
  86. while wait(1/30) do
  87. if h~=Mouse.Hit or t~=Mouse.Target then
  88. h,t=Mouse.Hit,Mouse.Target
  89. Event:FireServer({isMouse=true,Target=t,Hit=h})
  90. end
  91. end]==],Player.Character)
  92.  
  93. ----Sandboxed game object that allows the usage of client-side methods and services
  94. --Real game object
  95. local _rg = game
  96.  
  97. --Metatable for fake service
  98. local fsmt = {
  99. __index = function(self,k)
  100. local s = rawget(self,"_RealService")
  101. if s then
  102. return typeof(s[k])=="function"
  103. and function(_,...)return s[k](s,...)end or s[k]
  104. end
  105. end,
  106. __newindex = function(self,k,v)
  107. local s = rawget(self,"_RealService")
  108. if s then s[k]=v end
  109. end
  110. }
  111. local function FakeService(t,RealService)
  112. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  113. return setmetatable(t,fsmt)
  114. end
  115.  
  116. --Fake game object
  117. local g = {
  118. GetService = function(self,s)
  119. return rawget(self,s) or _rg:GetService(s)
  120. end,
  121. Players = FakeService({
  122. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  123. },"Players"),
  124. UserInputService = FakeService(UIS,"UserInputService"),
  125. ContextActionService = FakeService(CAS,"ContextActionService"),
  126. RunService = FakeService({
  127. _btrs = {},
  128. RenderStepped = _rg:GetService("RunService").Heartbeat,
  129. BindToRenderStep = function(self,name,_,fun)
  130. self._btrs[name] = self.Heartbeat:Connect(fun)
  131. end,
  132. UnbindFromRenderStep = function(self,name)
  133. self._btrs[name]:Disconnect()
  134. end,
  135. },"RunService")
  136. }
  137. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  138. g.service = g.GetService
  139. FakeService(g,game)
  140. --Changing owner to fake player object to support owner:GetMouse()
  141. game,owner = g,g.Players.LocalPlayer
  142. end
  143. timestopper = game.Players.LocalPlayer
  144. backpack = timestopper.Backpack
  145. TimeStop = Instance.new("Tool",backpack)
  146. TimeStop.Name = "Zawarudo"
  147. TimeStop.RequiresHandle = false
  148. timestopping = false
  149. --za warudo
  150. zawarudo =Instance.new("Sound",TimeStop)
  151. zawarudo.Volume = 10
  152. zawarudo.SoundId = 'rbxassetid://1055792303'
  153. zawarudo2 =Instance.new("Sound",TimeStop)
  154. zawarudo2.Volume = 10
  155. zawarudo2.SoundId = 'rbxassetid://4794460504'
  156. isfrozen = Instance.new("BoolValue",TimeStop)
  157. isfrozen.Value = false
  158. isfrozen.Name = "IsFrozen"
  159. local e = 0
  160. mouse = timestopper:GetMouse()
  161. cooldown = false
  162. TimeStop.Activated:Connect(function()
  163. if timestopping == false and cooldown == false then
  164. cooldown = true
  165. e = 0
  166. isfrozen.Value = true
  167. zawarudo:Play()
  168. timestopping = true
  169. colorcorrectioneffect = Instance.new("ColorCorrectionEffect",game.Lighting)
  170. colorcorrectioneffect.TintColor = Color3.fromRGB(255,255,255)
  171. colorcorrectioneffect.Saturation = 0
  172. coroutine.resume(coroutine.create(function()
  173. wait(2.8)
  174. Freeze()
  175. coroutine.resume(coroutine.create(function()
  176. for i = 1, 10 do
  177. e = e - 0.1
  178. colorcorrectioneffect.Saturation = e
  179. wait()
  180. end
  181. end))
  182. coroutine.resume(coroutine.create(function()
  183. wait()
  184. cooldown = false
  185. end))
  186. end))
  187. elseif timestopping == true and cooldown == false then
  188. e = 0
  189. cooldown = true
  190. timestopping = false
  191. isfrozen.Value = false
  192. zawarudo:Stop()
  193. zawarudo2:Play()
  194. colorcorrectioneffect:Destroy()
  195. unFreeze()
  196. coroutine.resume(coroutine.create(function()
  197. wait()
  198. cooldown = false
  199. end))
  200. end
  201. end)
  202. function Freeze() --This is Important, Freezes Everything unAnchored
  203. for i,v in pairs(workspace:GetDescendants()) do
  204. if v.ClassName == "Part" or v.ClassName == "MeshPart" then
  205. if v.Name ~= "Baseplate" then
  206. if v.Parent ~= owner.Character then
  207. if v.Name ~= "Handle" then
  208. v.Anchored = true
  209. end
  210. end
  211. end
  212. end
  213. end
  214. end
  215.  
  216. function unFreeze()
  217. for i,v in pairs(workspace:GetDescendants()) do
  218. if v.ClassName == "Part" or v.ClassName == "MeshPart" then
  219. if v.Name ~= "Baseplate" then
  220. if v.Parent ~= owner.Character then
  221. if v.Name ~= "Handle" then
  222. v.Anchored = false
  223. end
  224. end
  225. end
  226. end
  227. end
  228. end
Add Comment
Please, Sign In to add comment