marioisdabomb

Untitled

Jan 8th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.07 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. local p = owner
  85. local char = p.Character
  86. local size = 8
  87. part = function()
  88.  
  89. local a = Instance.new("Part", script)
  90. a.Anchored = true
  91. a.CanCollide = true
  92. a.CFrame = char.Torso.CFrame
  93. a.Size = Vector3.new(size, 0.2, 0.2)
  94. a.Transparency = 1
  95. return a
  96. end
  97.  
  98. part2 = function()
  99.  
  100. local a = Instance.new("Part", script)
  101. a.Anchored = true
  102. a.CanCollide = true
  103. a.CFrame = char.Torso.CFrame
  104. a.Size = Vector3.new(0.2, size, 0.2)
  105. a.Transparency = 1
  106. return a
  107. end
  108.  
  109. part3 = function()
  110.  
  111. local a = Instance.new("Part", script)
  112. a.Anchored = true
  113. a.CanCollide = false
  114. a.Size = Vector3.new(size, size, 1)
  115. a.Transparency = 0.7
  116. a.Material = "Neon"
  117. a.BrickColor = BrickColor.new("Really red")
  118. local b = Instance.new("BlockMesh", a)
  119. b.Scale = Vector3.new(1, 1, 0)
  120. return a
  121. end
  122.  
  123. local replicating = false
  124. local root, a, b, c, d, a2, b2, c2, d2, aa, bb, cc, dd, z, x, c, v, b, n = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
  125. replicate = function()
  126.  
  127. replicating = true
  128. script:ClearAllChildren()
  129. root = part()
  130. root.Transparency = 1
  131. root.Size = Vector3.new(0.2, 0.2, 0.2)
  132. root.CanCollide = false
  133. a = part()
  134. b = part()
  135. c = part()
  136. d = part()
  137. a2 = part()
  138. b2 = part()
  139. c2 = part()
  140. d2 = part()
  141. aa = part2()
  142. bb = part2()
  143. cc = part2()
  144. dd = part2()
  145. z = part3()
  146. x = part3()
  147. c = part3()
  148. v = part3()
  149. b = part3()
  150. n = part3()
  151. replicating = false
  152. end
  153.  
  154. script.ChildRemoved:connect(function(a)
  155.  
  156. if a.ClassName == "Part" and replicating == false then
  157. replicate()
  158. end
  159. end
  160. )
  161. replicate()
  162. local tick = 0
  163. CreateRegion3FromLocAndSize = function(Position, Size)
  164.  
  165. local SizeOffset = Size / 2
  166. local Point1 = Position - SizeOffset
  167. local Point2 = Position + SizeOffset
  168. return Region3.new(Point1, Point2)
  169. end
  170.  
  171. local set = false
  172. local whitelist = {"Hieroku", "PPATTA", "DevGamerzz", "I kill U", "kash5", "ZeroCrimson", "Zaidia", "tsup2", "PointCoded", "CLarramore", "Suzuuki", "", "", ""}
  173. p.Chatted:connect(function(ms)
  174.  
  175. if ms:sub(1, 5) == "size-" then
  176. size = tonumber(ms:sub(6))
  177. replicate()
  178. else
  179. if ms:sub(1, 4) == "set-" then
  180. set = true
  181. z.CanCollide = false
  182. x.CanCollide = false
  183. c.CanCollide = false
  184. v.CanCollide = false
  185. b.CanCollide = false
  186. n.CanCollide = false
  187. else
  188. if ms:sub(1, 6) == "unset-" then
  189. set = false
  190. z.CanCollide = false
  191. x.CanCollide = false
  192. c.CanCollide = false
  193. v.CanCollide = false
  194. b.CanCollide = false
  195. n.CanCollide = false
  196. else
  197. if ms:sub(1, 10) == "whitelist-" then
  198. table.insert(whitelist, ms:sub(11))
  199. else
  200. if ms:sub(1, 12) == "unwhitelist-" then
  201. for i,v in pairs(whitelist) do
  202. if ms:sub(13) == v then
  203. table.remove(whitelist, i)
  204. break
  205. end
  206. end
  207. end
  208. end
  209. end
  210. end
  211. end
  212. end
  213. )
  214. local magicpos = nil
  215. game:GetService("RunService").Heartbeat:connect(function()
  216.  
  217. pcall(function()
  218.  
  219. local void = char:GetChildren()
  220. for _,pl in pairs(whitelist) do
  221. if game.Players:FindFirstChild(pl) ~= nil and game.Players:FindFirstChild(pl).Character ~= nil then
  222. for i,v in pairs(game.Players[pl].Character:GetChildren()) do
  223. table.insert(void, v)
  224. end
  225. end
  226. end
  227. for i,v in pairs(game.Players:GetPlayers()) do
  228. if v.Character:isDescendantOf(char) and not v.Name == "FangxWulf" then
  229. v:LoadCharacter()
  230. end
  231. end
  232. char.Humanoid.Health = math.huge
  233. tick = tick + 0.01
  234. if not set then
  235. root.CFrame = root.CFrame:lerp(CFrame.new(char.Torso.CFrame.p) * CFrame.Angles(math.sin(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2)), 0.1)
  236. magicpos = char.Torso.CFrame
  237. else
  238. root.CFrame = root.CFrame:lerp(CFrame.new(magicpos.p) * CFrame.Angles(0, 0, 0), 0.05)
  239. end
  240. local reg = CreateRegion3FromLocAndSize(root.CFrame.p, Vector3.new(size, size, size))
  241. for i,v in pairs(game.Workspace:FindPartsInRegion3WithIgnoreList(reg, void, 100)) do
  242. if v.Name ~= "Base" then
  243. v:Destroy()
  244. end
  245. end
  246. a.CFrame = root.CFrame * CFrame.new(size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  247. b.CFrame = root.CFrame * CFrame.new(-size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  248. c.CFrame = root.CFrame * CFrame.new(0, size / 2, size / 2)
  249. d.CFrame = root.CFrame * CFrame.new(0, size / 2, -size / 2)
  250. a2.CFrame = root.CFrame * CFrame.new(size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  251. b2.CFrame = root.CFrame * CFrame.new(-size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  252. c2.CFrame = root.CFrame * CFrame.new(0, -size / 2, size / 2)
  253. d2.CFrame = root.CFrame * CFrame.new(0, -size / 2, -size / 2)
  254. aa.CFrame = root.CFrame * CFrame.new(size / 2, 0, size / 2)
  255. bb.CFrame = root.CFrame * CFrame.new(-size / 2, 0, size / 2)
  256. cc.CFrame = root.CFrame * CFrame.new(-size / 2, 0, -size / 2)
  257. dd.CFrame = root.CFrame * CFrame.new(size / 2, 0, -size / 2)
  258. z.CFrame = root.CFrame * CFrame.new(size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0)
  259. x.CFrame = root.CFrame * CFrame.new(-size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0)
  260. c.CFrame = root.CFrame * CFrame.new(0, 0, size / 2) * CFrame.Angles(0, 0, math.rad(90))
  261. v.CFrame = root.CFrame * CFrame.new(0, 0, -size / 2) * CFrame.Angles(0, 0, math.rad(90))
  262. b.CFrame = root.CFrame * CFrame.new(0, size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0)
  263. n.CFrame = root.CFrame * CFrame.new(0, -size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0)
  264. end
  265. )
  266. end
  267. )
Add Comment
Please, Sign In to add comment