Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Use h/ Buster ") end
- warn(" credits goes to the real creator ")
- 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()}
- 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
- 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 s[k] end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end,
- __call = function(self,...)
- local s = rawget(self,"_RealService")
- if s then return s(...) 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 self[s]
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- g.RunService = FakeService({
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- setmetatable(g,{
- __index=function(self,s)
- return _rg:GetService(s) or typeof(_rg[s])=="function"
- and function(_,...)return _rg[s](_rg,...)end or _rg[s]
- end,
- __newindex = fsmt.__newindex,
- __call = fsmt.__call
- })
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- --Made by mrfunnylaughs4. This sure is some weird button.
- local debounce = false
- ---------------------------------------------------
- ---------------------Functions---------------------
- ---------------------------------------------------
- local function SmoothPart(part)
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.LeftSurface = "Smooth"
- part.RightSurface = "Smooth"
- part.FrontSurface = "Smooth"
- part.BackSurface = "Smooth"
- end
- local function Effect(Length, Type, SizeStart, SizeEnd, Position, Colour, Parent, CanCollide)
- local part = Instance.new("Part")
- part.Name = Type
- part.CFrame = Position
- part.CanCollide = CanCollide or false
- part.Size = SizeStart
- part.Anchored = true
- part.BrickColor = BrickColor.new(tostring(Colour))
- part.Parent = Parent or workspace
- if Type == "Block" then
- SmoothPart(part)
- end
- if Type == "Sphere" then
- part.Shape = Enum.PartType.Ball
- SmoothPart(part)
- end
- if Type == "TwirlSwirl" then
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshType = Enum.MeshType.FileMesh
- mesh.MeshId = "rbxassetid://662585058"
- mesh.Name = "SwirlMesh"
- mesh.Scale = SizeStart / Vector3.new(500, 500, 500)
- mesh.Parent = part
- end
- if Type == "Wave" or Type == "SpiralWave" then
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshType = Enum.MeshType.FileMesh
- mesh.MeshId = "rbxassetid://20329976"
- mesh.Name = "WaveMesh"
- mesh.Scale = SizeStart / Vector3.new(4, 4, 4)
- mesh.Parent = part
- end
- if Type == "MeshSphere" then
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshType = Enum.MeshType.Sphere
- mesh.Parent = part
- SmoothPart(part)
- end
- spawn(function()
- local TwirlAngle = math.random(-250, 250) / 1000
- local WaveAngle = math.random(-500, 500) / 1000
- for i = 1, Length do
- game:GetService("RunService").Heartbeat:Wait()
- part.Transparency = part.Transparency + 1 / Length
- part.Size = part.Size + SizeEnd / Vector3.new(Length, Length, Length)
- if Type == "TwirlSwirl" then
- part.CFrame = part.CFrame * CFrame.Angles(TwirlAngle, TwirlAngle, TwirlAngle)
- part.SwirlMesh.Scale = part.SwirlMesh.Scale + SizeEnd / Vector3.new(Length * 500, Length * 500, Length * 500)
- end
- if Type == "SpiralWave" then
- part.CFrame = part.CFrame * CFrame.Angles(WaveAngle, WaveAngle, WaveAngle)
- part.WaveMesh.Scale = part.WaveMesh.Scale + SizeEnd / Vector3.new(Length * 4, Length * 4, Length * 4)
- end
- if Type == "Wave" then
- part.CFrame = part.CFrame * CFrame.Angles(0, WaveAngle, 0)
- part.WaveMesh.Scale = part.WaveMesh.Scale + SizeEnd / Vector3.new(Length * 4, Length * 4, Length * 4)
- end
- end
- part:Destroy()
- end)
- end
- ---------------------------------------------------
- -----------------Making the button-----------------
- ---------------------------------------------------
- local model = Instance.new("Model")
- model.Name = "Button"
- model.Parent = workspace
- local base = Instance.new("Part")
- base.Name = "Base"
- base.Size = Vector3.new(1, 4, 4)
- base.Shape = Enum.PartType.Cylinder
- base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- base.BrickColor = BrickColor.new("Medium stone grey")
- base.Anchored = true
- base.Locked = true
- SmoothPart(base)
- base.Parent = model
- local button = Instance.new("Part")
- button.Name = "Button"
- button.Size = Vector3.new(1, 3.4, 3.4)
- button.Shape = Enum.PartType.Cylinder
- button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
- button.BrickColor = BrickColor.new("Bright red")
- button.Anchored = true
- button.Locked = true
- SmoothPart(button)
- button.Parent = model
- local click = Instance.new("ClickDetector")
- click.Name = "MouseClickDetect"
- click.MaxActivationDistance = 8
- click.Parent = button
- ---------------------------------------------------
- ----------------------Attacks----------------------
- ---------------------------------------------------
- game:GetService("RunService").Heartbeat:Connect(function()
- if not click:FindFirstChild("EventHooked") then
- local val = Instance.new("BoolValue")
- val.Name = "EventHooked"
- val.Parent = click
- click.MouseClick:Connect(function(player)
- if debounce == false then
- debounce = true
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://1677936333"
- sound.Volume = 5
- sound.Parent = button
- sound:Play()
- button.CFrame = button.CFrame + Vector3.new(0, -0.15, 0)
- wait(0.2)
- button.CFrame = button.CFrame + Vector3.new(0, 0.15, 0)
- wait(0.05)
- local sound2 = Instance.new("Sound")
- sound2.SoundId = "rbxassetid://3065165447"
- sound2.Volume = 1000
- sound2.Parent = button
- sound2:Play()
- wait(1.55)
- sound:Destroy()
- sound2:Destroy()
- local choice = math.random(1, 4)
- if choice == 1 then
- local Char = player.Character
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://130972023"
- sound.Volume = 5
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- Effect(40, "Sphere", Vector3.new(2, 2, 2), Vector3.new(15, 15, 15), Char.HumanoidRootPart.CFrame, BrickColor.new("Really black"), Char)
- for i = 1, 4 do
- Effect(40, "SpiralWave", Vector3.new(10, 2, 10), Vector3.new(40, 8, 40), Char.HumanoidRootPart.CFrame, BrickColor.new("Really black"), Char)
- end
- for i,v in pairs(Char:GetChildren()) do
- if v:IsA("BasePart") and not v:IsA("Terrain") then
- v:BreakJoints()
- v.Velocity = Vector3.new(math.random(-25, 25), 30, math.random(-25, 25))
- end
- end
- elseif choice == 2 then
- local Char = player.Character
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://1368583274"
- sound.Volume = 5
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- for i = 1, 120 do
- game:GetService("RunService").Heartbeat:Wait()
- sound.Volume = sound.Volume - 5 / 120
- Effect(15, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
- end
- sound:Destroy()
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://165970126"
- sound.Volume = 2
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- Effect(20, "MeshSphere", Vector3.new(5, 15, 5), Vector3.new(8, 90, 8), Char.HumanoidRootPart.CFrame, BrickColor.new("Institutional white"), Char)
- for i = 1, 4 do
- Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(40, 8, 40), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
- end
- local vel = Instance.new("BodyVelocity")
- vel.MaxForce = Vector3.new(1e9, 1e9, 1e9)
- vel.Velocity = Vector3.new(0, 300, 0)
- vel.Parent = Char.HumanoidRootPart
- spawn(function()
- wait(0.5)
- vel:Destroy()
- end)
- elseif choice == 3 then
- local Char = player.Character
- local hole = Instance.new("Part")
- hole.Name = "Hole"
- hole.Color = Color3.new(0, 0, 0)
- hole.Shape = Enum.PartType.Cylinder
- hole.CFrame = Char.HumanoidRootPart.CFrame * CFrame.new(0, -3.04, 0) * CFrame.Angles(0, 0, math.pi / 2)
- hole.Size = Vector3.new(0.1, 0, 0)
- hole.Anchored = true
- hole.Locked = true
- hole.Material = Enum.Material.Neon
- hole.CanCollide = false
- SmoothPart(hole)
- hole.Parent = Char
- Char.Head.Anchored = true
- for i = 1, 35 do
- game:GetService("RunService").Heartbeat:Wait()
- hole.Size = hole.Size + Vector3.new(0, 0.2 * Char.HumanoidRootPart.Size.Z, 0.2 * Char.HumanoidRootPart.Size.Z)
- end
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://838038142"
- sound.Volume = 2
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- repeat
- game:GetService("RunService").Heartbeat:Wait()
- Char:SetPrimaryPartCFrame(Char.Head.CFrame * CFrame.new(0, -0.05, 0))
- hole.CFrame = hole.CFrame + Vector3.new(0, 0.05, 0)
- until Char.HumanoidRootPart.Position.Y < hole.Position.Y - 3.4 * Char.HumanoidRootPart.Size.Z
- sound:Destroy()
- for i = 1, 35 do
- game:GetService("RunService").Heartbeat:Wait()
- hole.Size = hole.Size - Vector3.new(0, 0.2 * Char.HumanoidRootPart.Size.Z, 0.2 * Char.HumanoidRootPart.Size.Z)
- end
- hole:Destroy()
- Char:BreakJoints()
- elseif choice == 4 then
- local Char = player.Character
- local sound = Instance.new("Sound")
- sound.SoundId = "rbxassetid://130972023"
- sound.Volume = 5
- sound.Parent = Char.HumanoidRootPart
- sound:Play()
- if Char:FindFirstChildOfClass("Humanoid") then
- for i = 1, 5 do
- Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
- end
- Char:FindFirstChildOfClass("Humanoid").PlatformStand = true
- else
- for i = 1, 5 do
- Effect(30, "Wave", Vector3.new(7, 1, 7), Vector3.new(20, 4, 20), Char.HumanoidRootPart.CFrame + Vector3.new(0, -2.5, 0), BrickColor.new("Mid gray"), Char)
- end
- local bodyforce = Instance.new("BodyForce")
- bodyforce.Force = Vector3.new(0, -500000, 0)
- bodyforce.Parent = Char.Head
- end
- end
- debounce = false
- end
- end)
- end
- end)
- ---------------------------------------------------
- --------------------Wrapping up--------------------
- ---------------------------------------------------
- while game:GetService("RunService").Heartbeat:Wait() do
- if model.Parent ~= workspace then
- model = Instance.new("Model")
- model.Name = "Button"
- base = Instance.new("Part")
- base.Name = "Base"
- base.Size = Vector3.new(1, 4, 4)
- base.Shape = Enum.PartType.Cylinder
- base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- base.BrickColor = BrickColor.new("Medium stone grey")
- base.Anchored = true
- base.Locked = true
- SmoothPart(base)
- base.Parent = model
- button = Instance.new("Part")
- button.Name = "Button"
- button.Size = Vector3.new(1, 3.4, 3.4)
- button.Shape = Enum.PartType.Cylinder
- button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
- button.BrickColor = BrickColor.new("Bright red")
- button.Anchored = true
- button.Locked = true
- SmoothPart(button)
- button.Parent = model
- click = Instance.new("ClickDetector")
- click.Name = "MouseClickDetect"
- click.MaxActivationDistance = 8
- click.Parent = button
- model.Parent = workspace
- end
- if base.Parent ~= model then
- base = Instance.new("Part")
- base.Name = "Base"
- base.Size = Vector3.new(1, 4, 4)
- base.Shape = Enum.PartType.Cylinder
- base.CFrame = CFrame.new(0, 0.5, 0, 0, 0, 1, -1, 0, 0, 0, -1, 0)
- base.BrickColor = BrickColor.new("Medium stone grey")
- base.Anchored = true
- base.Locked = true
- SmoothPart(base)
- base.Parent = model
- end
- if button.Parent ~= model then
- button = Instance.new("Part")
- button.Name = "Button"
- button.Size = Vector3.new(1, 3.4, 3.4)
- button.Shape = Enum.PartType.Cylinder
- button.CFrame = CFrame.new(1.49011612e-08, 0.799999952, 0, -0, -0, 1, -1, -0, 0, -0, -1, 0)
- button.BrickColor = BrickColor.new("Bright red")
- button.Anchored = true
- button.Locked = true
- SmoothPart(button)
- button.Parent = model
- end
- if click.Parent ~= button then
- click = Instance.new("ClickDetector")
- click.Name = "MouseClickDetect"
- click.MaxActivationDistance = 8
- click.Parent = button
- model.Parent = workspace
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement