Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This script has been converted to FE by iPxter
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.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,Connect=function(self,f)self.Function=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 and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- 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 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})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- 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)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- --made by ur amigo slavedash
- --ur not supposed to be here anyways
- --Functions
- local function WeldTogether(part1, part2, anchored)
- part1.Anchored = true
- local weld = Instance.new("Weld", part1)
- weld.Part0 = part1
- weld.Part1 = part2
- weld.C0 = CFrame.new()
- weld.C1 = part2.CFrame:toObjectSpace(part1.CFrame)
- weld.Parent = part1
- if anchored then
- part1.Anchored = true
- else
- part1.Anchored = false
- end
- end
- --Player
- local plr = owner
- local mouse = Mouse
- repeat
- wait()
- until plr.Character
- local chr = plr.Character
- local humanoid = chr:FindFirstChild("Humanoid")
- local root = chr:FindFirstChild("HumanoidRootPart")
- --Services
- local debris = game:GetService("Debris")
- local userinputservice = game:GetService("UserInputService")
- local runservice = game:GetService("RunService")
- --Modes
- local super_mode = false
- local omaemode = false
- local selfdestruct = false
- local invisible = false
- --Particles
- local superfire = Instance.new("ParticleEmitter", root)
- superfire.Texture = "rbxassetid://248625108"
- superfire.Size = NumberSequence.new(5,0)
- superfire.Transparency = NumberSequence.new(0.8,1)
- superfire.LightEmission = 1
- superfire.ZOffset = 1
- superfire.Lifetime = NumberRange.new(1,1)
- superfire.Drag = -2
- superfire.Enabled = false
- superfire.Rate = 100
- --Sound
- local supermusic = Instance.new("Sound", root)
- supermusic.SoundId = "rbxassetid://333361404"
- supermusic.Volume = 0.1
- supermusic.EmitterSize = 5
- supermusic.Looped = true
- supermusic.PlaybackSpeed = 1.2
- local omaewa = Instance.new("Sound", root)
- omaewa.SoundId = "rbxassetid://157707359"
- omaewa.Volume = 0.5
- omaewa.EmitterSize = 5
- omaewa.PlaybackSpeed = 1.1
- --C4
- local bombs = Instance.new("Model", chr)
- bombs.Name = "Bombs"
- local explosions = Instance.new("Model", bombs)
- explosions.Name = "Explosions"
- local C4s = Instance.new("Model", bombs)
- C4s.Name = "C4s"
- local C4main = Instance.new("Part")
- C4main.Anchored = true
- C4main.CanCollide = true
- C4main.Size = Vector3.new()
- C4main.Material = Enum.Material.SmoothPlastic
- C4main.Transparency = 0
- C4main.BrickColor = BrickColor.new("Institutional white")
- C4main.Name = "C4"
- local C4mesh = Instance.new("SpecialMesh", C4main)
- C4mesh.MeshType = "FileMesh"
- C4mesh.Scale = Vector3.new(1,1,1)
- C4mesh.MeshId = "rbxassetid://104516854"
- C4mesh.TextureId = "rbxassetid://104516981"
- --Place C4
- local function PlaceC4(ceeframe)
- local C4clone = C4main:Clone()
- C4clone.Anchored = false
- C4clone.CFrame = ceeframe
- if invisible then
- C4clone.Transparency = 0.95
- end
- C4clone.Parent = C4s
- if mouse.Target then
- WeldTogether(C4clone, mouse.Target, false)
- end
- end
- local function Spladow(blowupthing)
- coroutine.resume(coroutine.create(function()
- local explosion = Instance.new("Part", explosions)
- explosion.Name = "Explosion"
- explosion.Shape = "Ball"
- explosion.Material = Enum.Material.Neon
- explosion.BrickColor = BrickColor.new("Bright yellow")
- explosion.Anchored = true
- explosion.CanCollide = false
- explosion.Size = Vector3.new(1,1,1)
- explosion.CFrame = blowupthing.CFrame
- local boomsound = Instance.new("Sound", explosion)
- boomsound.SoundId = "rbxassetid://365002938"
- boomsound.Volume = 1
- boomsound.EmitterSize = 5
- boomsound:Play()
- coroutine.resume(coroutine.create(function()
- for i=1,3 do
- for i,v in pairs(game.Workspace:FindPartsInRegion3(Region3.new(explosion.Position - (explosion.Size/2), explosion.Position + (explosion.Size/2)), nil, math.huge)) do
- if not (v:IsDescendantOf(chr)) or selfdestruct then
- if not (v:IsDescendantOf(bombs)) then
- if (v.Name ~= "Base") and (v.Name ~= "Baseplate") then
- v.Anchored = false
- v:BreakJoints()
- v.Velocity = v.Velocity + ((v.Position - explosion.Position).unit * 50)
- if super_mode then
- v:Destroy()
- end
- end
- end
- end
- end
- explosion.Size = explosion.Size + Vector3.new(5,5,5)
- if super_mode then
- explosion.Size = explosion.Size * 1.1
- end
- explosion.Transparency = explosion.Transparency + (0.1 * 2)
- wait(0.05)
- end
- explosion.Transparency = 1
- wait(0.5)
- explosion:Destroy()
- boomsound:Destroy()
- end))
- blowupthing:Destroy()
- end))
- end
- local function BlowUp()
- if #C4s:GetChildren() > 0 then
- if omaemode then
- omaewa:Play()
- repeat
- wait()
- until not omaewa.Playing
- omaewa:Stop()
- wait(0.2)
- for i,v in pairs(C4s:GetChildren()) do
- Spladow(v)
- end
- else
- for i,v in pairs(C4s:GetChildren()) do
- Spladow(v)
- if super_mode then
- wait(0.05)
- else
- wait(0.1)
- end
- end
- end
- end
- end
- --Controls
- userinputservice.InputBegan:connect(function(input, gpe)
- if not gpe then
- if input.UserInputType == Enum.UserInputType.Keyboard then
- local key = input.KeyCode
- --C4 Placing and Blowing Up
- if key == Enum.KeyCode.Q then
- PlaceC4(mouse.Hit)
- wait(0.1)
- if super_mode and userinputservice:IsKeyDown(Enum.KeyCode.Q) then
- repeat
- PlaceC4(mouse.Hit)
- wait()
- until not super_mode or not userinputservice:IsKeyDown(Enum.KeyCode.Q)
- end
- end
- if key == Enum.KeyCode.E then
- BlowUp()
- end
- --Modes
- if key == Enum.KeyCode.L then
- if super_mode then
- super_mode = false
- superfire.Enabled = false
- supermusic.Playing = false
- else
- super_mode = true
- superfire.Enabled = true
- supermusic.Playing = true
- end
- end
- if key == Enum.KeyCode.K then
- if omaemode then
- omaemode = false
- else
- omaemode = true
- end
- end
- if key == Enum.KeyCode.J then
- if selfdestruct then
- selfdestruct = false
- else
- selfdestruct = true
- end
- end
- if key == Enum.KeyCode.H then
- if invisible then
- invisible = false
- else
- invisible = true
- end
- end
- --Other
- if key == Enum.KeyCode.P then
- C4s:ClearAllChildren()
- explosions:ClearAllChildren()
- end
- end
- end
- end)
- --Health
- runservice.Heartbeat:connect(function()
- humanoid.MaxHealth = math.huge
- humanoid.Health = math.huge
- humanoid.PlatformStand = false
- if not super_mode then
- humanoid.WalkSpeed = 16
- humanoid.JumpPower = 50
- elseif super_mode then
- humanoid.WalkSpeed = 32
- humanoid.JumpPower = 75
- end
- end)
- --control guide
- print([["Controls:
- Q to place C4
- E to blow up C4s.
- P to clear all C4s and explosions
- L for super mode
- K for omae wa mou shindeiru
- J to enable the C4s to kill you
- H to make C4s invisible"]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement