Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return m:TrigEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local Mouse = Player:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return rawget(self,s) or _rg:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- FakeService(g,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- local list = {}
- local minimumsize = Vector3.new(0.6,0.6,0.6)
- local fragmentable = workspace
- local surface_between_splitted_parts = 'SmoothNoOutlines'
- function fragmentate(cframe,size,color,explosion_position,explosion_blastradius,backsurface,bottomsurface,frontsurface,leftsurface,rightsurface,topsurface,transparency,reflectance,material,anchored,heck,ree,same)
- local xi = size.X >= minimumsize.X*(1+explosion_blastradius/16) and 2 or 1
- local yi = size.Y >= minimumsize.Y*(1+explosion_blastradius/16) and 2 or 1
- local zi = size.Z >= minimumsize.Z*(1+explosion_blastradius/16) and 2 or 1
- if xi == 1 and yi == 1 and zi == 1 or (cframe.p-explosion_position).magnitude > size.magnitude/2 + explosion_blastradius then
- if xi == 1 and yi == 1 and zi == 1 then return end
- local p = Instance.new("Part",fragmentable)
- p.BrickColor = color
- p.FormFactor = "Custom"
- if heck then
- p.Anchored = anchored
- else
- p.Anchored = false
- end
- p.Size = size
- p.BackSurface = backsurface
- p.BottomSurface = bottomsurface
- p.FrontSurface = frontsurface
- p.LeftSurface = leftsurface
- p.RightSurface = rightsurface
- if heck ~= true or ree == true then
- local int = Instance.new('IntValue',p)
- int.Name = 'already broken u pleb'
- end
- p.TopSurface = topsurface
- if redmode and ree and same ~= true then
- spawn(function()
- repeat
- p.Color = Color3.new(1,0,0)
- p.Material = Enum.Material.Neon
- wait()
- until p.Color == Color3.new(1,0,0) and p.Material == Enum.Material.Neon
- end)
- end
- p.Transparency = transparency
- p.Material = material
- if heck ~= true or ree then
- game:GetService('Debris'):AddItem(p,10)
- end
- p.CFrame = cframe
- p.Reflectance = reflectance
- p:BreakJoints()
- return
- end
- local mody = math.random(-125,125)/1000
- for y = 1,yi do
- if math.random()> 0.5 then
- local modx = math.random(-125,125)/1000
- for x = 1,xi do
- local modz = math.random(-125,125)/1000
- for z = 1,zi do --offset = x/xi-0.75+modx)
- 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)),
- 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,
- zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
- z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
- 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,
- y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance,material,anchored,heck,ree,same)
- end
- end
- else
- local modz = math.random(-125,125)/1000
- for z = 1,zi do
- local modx = math.random(-125,125)/1000
- for x = 1,xi do
- 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)),
- 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,
- zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
- z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
- 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,
- y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance,material,anchored,heck,ree,same)
- end
- end
- end
- end
- end
- function start_fragmentation(position,radius,bigoof,smoloof,samecolor)
- if bigoof then
- workspace:FindFirstChildOfClass('Terrain'):FillBall(position,radius*2,Enum.Material.Air)
- end
- local search = Region3.new(position-Vector3.new(radius,radius,radius)*1.1,position+Vector3.new(radius,radius,radius)*1.1)
- repeat
- local finish = false
- local parts = workspace:FindPartsInRegion3WithIgnoreList(search,list,100)
- for i = 1,#parts do
- table.insert(list,1,parts[i])
- end
- finish = true
- until #parts < 100 and finish
- local t = tick()
- for i = 1,#list do
- local p = list[i]
- 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
- if bigoof ~= true then
- local thingy = p
- local humm = p.Parent
- thingy.Parent = nil
- spawn(function()
- wait(10)
- thingy.Parent = humm
- end)
- else
- p:Destroy()
- end
- 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)
- end
- end
- list = {}
- end
- function firer(pos)
- for i=1,8 do
- fiore = Instance.new("Part",workspace)
- fiore.Massless = true
- fiore.Name = "fuieror"
- BOOMA = Instance.new("Sound",fiore)
- BOOMA.SoundId = "rbxassetid://4643825537"
- BOOMA.Volume = 10
- BOOMA:Play()
- fiore.Size = Vector3.new(1,1,1)
- fiore.Transparency = 1
- fiore.Position = pos
- Instance.new("Fire",fiore).Name = "fireor"
- fiore.Velocity = Vector3.new(math.random(1,50),math.random(1,50),math.random(1,50))
- end
- end
- function zaphit(hitpos)
- local exp = Instance.new('Explosion',workspace)
- exp.Position = hitpos
- exp.DestroyJointRadiusPercent = 0
- exp.BlastRadius = 9
- firer(hitpos)
- start_fragmentation(hitpos,7.5,true)
- exp.Hit:connect(function(hit)
- if hit.Parent and hit.Parent:FindFirstChildOfClass('Humanoid') then
- if hit.Parent ~= game.Players.LocalPlayer.Character then
- for i,v in pairs(hit.Parent:GetDescendants()) do
- if v:IsA('BasePart')then
- pcall(function()
- v.Parent = fragmentable
- end)
- local backpr = minimumsize
- minimumsize = Vector3.new(0.6,0.6,0.6)
- start_fragmentation(v.Position,0.05,true,true)
- minimumsize = backpr
- end
- end
- end
- end
- end)
- end
- torso = game.Players.LocalPlayer.Character.HumanoidRootPart
- mouse = game.Players.LocalPlayer:GetMouse()
- RunService = game["RunService"]
- Character = torso.Parent
- VirtualBody = Character
- H = Instance.new("Part",Character)
- H.Anchored = true
- H.Size = torso.Size
- H.Transparency = 1
- function woohoo(charg,waittime)
- coroutine.resume(coroutine.create(function()
- H.CFrame = charg.HumanoidRootPart.CFrame * CFrame.new(0,100,-1500)
- --torso.Parent.Humanoid:MoveTo(movetothing)
- --char.Torso.Parent.Humanoid.Jump = true
- charg.HumanoidRootPart.CFrame = charg.HumanoidRootPart.CFrame * CFrame.new(0,2,0)
- a = Instance.new("BodyPosition",charg.HumanoidRootPart)
- a.MaxForce = Vector3.new(9999,9999,9999)
- --a.Position = torso.Position + Vector3.new(0,9000,0)
- a.Position = H.Position
- charg.Humanoid.PlatformStand = true
- wait(waittime)
- po = false
- for i,v in pairs(charg.HumanoidRootPart:GetChildren()) do
- if v.ClassName == a.ClassName then
- v:Destroy()
- end
- end
- charg.HumanoidRootPart.Touched:Connect(function()
- charg.HumanoidRootPart:Destroy()
- zaphit(charg.Head.Position)
- end)
- a = Instance.new("Sound",charg.Head)
- a.SoundId = "rbxassetid://188565209"
- a.Volume = 10
- a:Play()
- --b = Instance.new("BodyPosition",char)
- --b.MaxForce = Vector3.new(9999,9999,9999)
- --b.Position = movetothing
- --a.Position = Point
- wait(2)
- -- for i,v in pairs(torso:GetChildren()) do
- -- if v.ClassName == b.ClassName then
- -- v:Destroy()
- -- end
- -- end
- end))
- end
- mouse.Button1Down:Connect(function()
- --torso.Velocity = torso.Velocity + Vector3.new(0,40,0) *10
- if mouse.Target.Parent ~= nil and mouse.Target.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
- woohoo(mouse.Target.Parent,0.3)
- end
- end)
- torso = game.Players.LocalPlayer.Character.HumanoidRootPart
- mouse = game.Players.LocalPlayer:GetMouse()
- mouse.Button1Down:Connect(function()
- --zaphit(mouse.Hit.p)
- torso.Velocity = Vector3.new(0,8000,0) * 400
- end)
Add Comment
Please, Sign In to add comment