sIendytubble

flinger

Apr 13th, 2021 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.49 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,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  51. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then
  95. return typeof(s[k])=="function"
  96. and function(_,...)return s[k](s,...)end or s[k]
  97. end
  98. end,
  99. __newindex = function(self,k,v)
  100. local s = rawget(self,"_RealService")
  101. if s then s[k]=v end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return rawget(self,s) or _rg:GetService(s)
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. RunService = FakeService({
  120. _btrs = {},
  121. RenderStepped = _rg:GetService("RunService").Heartbeat,
  122. BindToRenderStep = function(self,name,_,fun)
  123. self._btrs[name] = self.Heartbeat:Connect(fun)
  124. end,
  125. UnbindFromRenderStep = function(self,name)
  126. self._btrs[name]:Disconnect()
  127. end,
  128. },"RunService")
  129. }
  130. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  131. g.service = g.GetService
  132. FakeService(g,game)
  133. --Changing owner to fake player object to support owner:GetMouse()
  134. game,owner = g,g.Players.LocalPlayer
  135. end
  136. --Converted with ttyyuu12345's model to script plugin v4
  137. function sandbox(var,func)
  138. local env = getfenv(func)
  139. local newenv = setmetatable({},{
  140. __index = function(self,k)
  141. if k=="script" then
  142. return var
  143. else
  144. return env[k]
  145. end
  146. end,
  147. })
  148. setfenv(func,newenv)
  149. return func
  150. end
  151. local list = {}
  152. local minimumsize = Vector3.new(0.6,0.6,0.6)
  153. local fragmentable = workspace
  154. local surface_between_splitted_parts = 'SmoothNoOutlines'
  155. function fragmentate(cframe,size,color,explosion_position,explosion_blastradius,backsurface,bottomsurface,frontsurface,leftsurface,rightsurface,topsurface,transparency,reflectance,material,anchored,heck,ree,same)
  156. local xi = size.X >= minimumsize.X*(1+explosion_blastradius/16) and 2 or 1
  157. local yi = size.Y >= minimumsize.Y*(1+explosion_blastradius/16) and 2 or 1
  158. local zi = size.Z >= minimumsize.Z*(1+explosion_blastradius/16) and 2 or 1
  159. if xi == 1 and yi == 1 and zi == 1 or (cframe.p-explosion_position).magnitude > size.magnitude/2 + explosion_blastradius then
  160. if xi == 1 and yi == 1 and zi == 1 then return end
  161. local p = Instance.new("Part",fragmentable)
  162. p.BrickColor = color
  163. p.FormFactor = "Custom"
  164. if heck then
  165. p.Anchored = anchored
  166. else
  167. p.Anchored = false
  168. end
  169. p.Size = size
  170. p.BackSurface = backsurface
  171. p.BottomSurface = bottomsurface
  172. p.FrontSurface = frontsurface
  173. p.LeftSurface = leftsurface
  174. p.RightSurface = rightsurface
  175. if heck ~= true or ree == true then
  176. local int = Instance.new('IntValue',p)
  177. int.Name = 'already broken u pleb'
  178. end
  179. p.TopSurface = topsurface
  180. if redmode and ree and same ~= true then
  181. spawn(function()
  182. repeat
  183. p.Color = Color3.new(1,0,0)
  184. p.Material = Enum.Material.Neon
  185. wait()
  186. until p.Color == Color3.new(1,0,0) and p.Material == Enum.Material.Neon
  187. end)
  188. end
  189. p.Transparency = transparency
  190. p.Material = material
  191. if heck ~= true or ree then
  192. game:GetService('Debris'):AddItem(p,10)
  193. end
  194. p.CFrame = cframe
  195. p.Reflectance = reflectance
  196. p:BreakJoints()
  197. return
  198. end
  199. local mody = math.random(-125,125)/1000
  200. for y = 1,yi do
  201. if math.random()> 0.5 then
  202. local modx = math.random(-125,125)/1000
  203. for x = 1,xi do
  204. local modz = math.random(-125,125)/1000
  205. for z = 1,zi do --offset = x/xi-0.75+modx)
  206. fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)),
  207. Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  208. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
  209. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  210. z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  211. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance,material,anchored,heck,ree,same)
  212. end
  213.  
  214. end
  215. else
  216. local modz = math.random(-125,125)/1000
  217. for z = 1,zi do
  218. local modx = math.random(-125,125)/1000
  219. for x = 1,xi do
  220. fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)),
  221. Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  222. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
  223. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  224. z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  225. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance,material,anchored,heck,ree,same)
  226. end
  227. end
  228. end
  229. end
  230. end
  231.  
  232. function start_fragmentation(position,radius,bigoof,smoloof,samecolor)
  233. if bigoof then
  234. workspace:FindFirstChildOfClass('Terrain'):FillBall(position,radius*2,Enum.Material.Air)
  235. end
  236. local search = Region3.new(position-Vector3.new(radius,radius,radius)*1.1,position+Vector3.new(radius,radius,radius)*1.1)
  237. repeat
  238. local finish = false
  239. local parts = workspace:FindPartsInRegion3WithIgnoreList(search,list,100)
  240. for i = 1,#parts do
  241. table.insert(list,1,parts[i])
  242. end
  243. finish = true
  244. until #parts < 100 and finish
  245. local t = tick()
  246. for i = 1,#list do
  247. local p = list[i]
  248. if p:FindFirstChild('already broken u pleb') == nil and p:IsA('CornerWedgePart') == false and p:IsA('TrussPart') == false and p:IsA('WedgePart') == false and p.Parent and p.Parent.Name ~= "Projectile" and p:IsDescendantOf(fragmentable) and (p:GetMass()<50000 or p.Anchored == true) and p.Name ~= "fuieror" and (p.Transparency>0.285 or (bigoof == true and (samecolor ~= true or p.Parent:FindFirstChildOfClass('Humanoid')))) and p.Name~='Base' and (p.Parent:FindFirstChildOfClass('Humanoid') == nil or smoloof == true) and (p.Parent.Parent:FindFirstChildOfClass('Humanoid') == nil or smoloof == true) then
  249. if bigoof ~= true then
  250. local thingy = p
  251. local humm = p.Parent
  252. thingy.Parent = nil
  253. spawn(function()
  254. wait(10)
  255. thingy.Parent = humm
  256. end)
  257. else
  258. p:Destroy()
  259. end
  260. fragmentate(p.CFrame,p.Size,p.BrickColor,position,radius,p.BackSurface,p.BottomSurface,p.FrontSurface,p.LeftSurface,p.RightSurface,p.TopSurface,p.Transparency,p.Reflectance,p.Material,p.Anchored,bigoof,smoloof,samecolor)
  261. end
  262. end
  263. list = {}
  264. end
  265. function firer(pos)
  266. for i=1,8 do
  267. fiore = Instance.new("Part",workspace)
  268. fiore.Massless = true
  269. fiore.Name = "fuieror"
  270. BOOMA = Instance.new("Sound",fiore)
  271. BOOMA.SoundId = "rbxassetid://4643825537"
  272. BOOMA.Volume = 10
  273. BOOMA:Play()
  274. fiore.Size = Vector3.new(1,1,1)
  275. fiore.Transparency = 1
  276. fiore.Position = pos
  277. Instance.new("Fire",fiore).Name = "fireor"
  278. fiore.Velocity = Vector3.new(math.random(1,50),math.random(1,50),math.random(1,50))
  279. end
  280. end
  281. function zaphit(hitpos)
  282. local exp = Instance.new('Explosion',workspace)
  283. exp.Position = hitpos
  284. exp.DestroyJointRadiusPercent = 0
  285. exp.BlastRadius = 9
  286. firer(hitpos)
  287. start_fragmentation(hitpos,7.5,true)
  288. exp.Hit:connect(function(hit)
  289. if hit.Parent and hit.Parent:FindFirstChildOfClass('Humanoid') then
  290. if hit.Parent ~= game.Players.LocalPlayer.Character then
  291. for i,v in pairs(hit.Parent:GetDescendants()) do
  292. if v:IsA('BasePart')then
  293. pcall(function()
  294. v.Parent = fragmentable
  295. end)
  296. local backpr = minimumsize
  297. minimumsize = Vector3.new(0.6,0.6,0.6)
  298. start_fragmentation(v.Position,0.05,true,true)
  299. minimumsize = backpr
  300. end
  301. end
  302. end
  303. end
  304. end)
  305. end
  306. torso = game.Players.LocalPlayer.Character.HumanoidRootPart
  307. mouse = game.Players.LocalPlayer:GetMouse()
  308. RunService = game["RunService"]
  309. Character = torso.Parent
  310. VirtualBody = Character
  311. H = Instance.new("Part",Character)
  312. H.Anchored = true
  313. H.Size = torso.Size
  314. H.Transparency = 1
  315. function woohoo(charg,waittime)
  316. coroutine.resume(coroutine.create(function()
  317. H.CFrame = charg.HumanoidRootPart.CFrame * CFrame.new(0,100,-1500)
  318. --torso.Parent.Humanoid:MoveTo(movetothing)
  319. --char.Torso.Parent.Humanoid.Jump = true
  320. charg.HumanoidRootPart.CFrame = charg.HumanoidRootPart.CFrame * CFrame.new(0,2,0)
  321. a = Instance.new("BodyPosition",charg.HumanoidRootPart)
  322. a.MaxForce = Vector3.new(9999,9999,9999)
  323. --a.Position = torso.Position + Vector3.new(0,9000,0)
  324. a.Position = H.Position
  325. charg.Humanoid.PlatformStand = true
  326. wait(waittime)
  327. po = false
  328. for i,v in pairs(charg.HumanoidRootPart:GetChildren()) do
  329. if v.ClassName == a.ClassName then
  330. v:Destroy()
  331. end
  332. end
  333. charg.HumanoidRootPart.Touched:Connect(function()
  334. charg.HumanoidRootPart:Destroy()
  335. zaphit(charg.Head.Position)
  336. end)
  337. a = Instance.new("Sound",charg.Head)
  338. a.SoundId = "rbxassetid://188565209"
  339. a.Volume = 10
  340. a:Play()
  341. --b = Instance.new("BodyPosition",char)
  342. --b.MaxForce = Vector3.new(9999,9999,9999)
  343. --b.Position = movetothing
  344. --a.Position = Point
  345. wait(2)
  346. -- for i,v in pairs(torso:GetChildren()) do
  347. -- if v.ClassName == b.ClassName then
  348. -- v:Destroy()
  349. -- end
  350. -- end
  351. end))
  352. end
  353. mouse.Button1Down:Connect(function()
  354. --torso.Velocity = torso.Velocity + Vector3.new(0,40,0) *10
  355. if mouse.Target.Parent ~= nil and mouse.Target.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  356. woohoo(mouse.Target.Parent,0.3)
  357. end
  358. end)
  359. torso = game.Players.LocalPlayer.Character.HumanoidRootPart
  360. mouse = game.Players.LocalPlayer:GetMouse()
  361. mouse.Button1Down:Connect(function()
  362. --zaphit(mouse.Hit.p)
  363. torso.Velocity = Vector3.new(0,8000,0) * 400
  364. end)
Add Comment
Please, Sign In to add comment