Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- 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 V2 by Talon")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- 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 TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(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
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled 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 every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true 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
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __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 RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame: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(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- local plr = game.Players.LocalPlayer
- local char = plr.Character
- local mouse = plr:GetMouse()
- local torso = char.Torso
- local rs = torso["Right Shoulder"]
- local ls = torso["Left Shoulder"]
- local rh = torso["Right Hip"]
- local lh = torso["Left Hip"]
- local rj = char.HumanoidRootPart.RootJoint
- local neck = torso.Neck
- local animpose = "Idle"
- local attacking = false
- local cananim = true
- local rage = false
- local shield
- local sprint = false
- local canrage = true
- local legs = true
- local bc = char:WaitForChild("Body Colors")
- local multiplier = 1
- local lac = char["Body Colors"].LeftArmColor
- local rac = char["Body Colors"].RightArmColor
- local rlc = char["Body Colors"].RightArmColor
- local llc = char["Body Colors"].LeftLegColor
- local hc = char["Body Colors"].HeadColor
- local tc = char["Body Colors"].TorsoColor
- local humanoid = char:FindFirstChildOfClass("Humanoid")
- local huge = Vector3.new(math.huge, math.huge, math.huge)
- local mobs = Instance.new("Sound", char)
- mobs.SoundId = "rbxassetid://245913129"
- mobs.Looped = true
- mobs.Volume = 3
- humanoid.MaxHealth = math.huge
- wait()
- humanoid.Health = math.huge
- humanoid.Name = "BOOM BOOM BOOOMMMM!"
- mobs:Play()
- if char:FindFirstChild("Animate") then
- char.Animate:Destroy()
- end
- if char:FindFirstChildOfClass("Humanoid"):FindFirstChild("Animator") then
- char:FindFirstChildOfClass("Humanoid").Animator:Destroy()
- end
- function legsonly()
- spawn(function()
- for i = 0, 10 do
- wait(0.001)
- if attacking then
- break
- end
- end
- if not attacking then
- legs = false
- end
- end)
- end
- function swait(t)
- if t == nil or t == 0 then
- game:service("RunService").Stepped:wait(0)
- else
- for i = 0, t do
- game:service("RunService").Stepped:wait(0)
- end
- end
- end
- function KICK(PLAYER)
- spawn(function()
- local function SKICK()
- if PLAYER.Character and PLAYER.Character:FindFirstChild("HumanoidRootPart") and PLAYER.Character:FindFirstChild("Torso") then
- PLAYER.Character.HumanoidRootPart.CFrame = CFrame.new(math.random(999000, 1001000), 1000000, 1000000)
- do
- local SP = Instance.new("SkateboardPlatform", PLAYER.Character)
- SP.Position = PLAYER.Character.HumanoidRootPart.Position
- SP.Transparency = 1
- spawn(function()
- repeat
- swait()
- if PLAYER.Character and PLAYER.Character:FindFirstChild("HumanoidRootPart") then
- SP.Position = PLAYER.Character.HumanoidRootPart.Position
- end
- until not game:GetService("Players"):FindFirstChild(PLAYER.Name)
- end)
- PLAYER.Character.Torso.Anchored = true
- end
- end
- end
- spawn(function()
- repeat
- wait()
- if PLAYER ~= nil then
- SKICK()
- end
- until not game:GetService("Players"):FindFirstChild(PLAYER.Name)
- if not game:GetService("Players"):FindFirstChild(PLAYER.Name) then
- print("REMOVED " .. PLAYER.Name)
- end
- end)
- end)
- end
- function hurt(hit, dmg)
- if hit.Parent then
- if hit.Parent:IsA("LocalScript") then
- print("bocks!11")
- hit.Parent:Destroy()
- end
- local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
- if hum and hum.Parent.Name ~= plr.Name then
- if dmg == "Kill" or hum.Health > 100000 then
- hit.Parent:BreakJoints()
- return true
- else
- if math.random(0, 100) == 50 then
- hum.Health = hum.Health - dmg * multiplier * 2.5
- else
- hum.Health = hum.Health - dmg * multiplier
- end
- return true
- end
- end
- end
- end
- function soundeffect(id, volume, speed, parent)
- spawn(function()
- local s = Instance.new("Sound")
- s.SoundId = id
- s.Volume = volume
- s.PlaybackSpeed = speed
- s.Parent = parent
- s:Play()
- repeat
- wait()
- until not s.Playing
- s:Destroy()
- end)
- end
- function gethum(obj)
- if obj.Parent and obj.Parent:FindFirstChild("Humanoid") and obj.Parent.Name ~= plr.Name then
- return obj.Parent:FindFirstChildOfClass("Humanoid")
- end
- end
- function smooth(obj)
- local sides = {
- "Left",
- "Right",
- "Top",
- "Bottom",
- "Front",
- "Back"
- }
- for i, v in pairs(sides) do
- obj[v .. "Surface"] = "SmoothNoOutlines"
- end
- end
- function fade(obj, dest, grow)
- spawn(function()
- local oldcf = obj.CFrame
- for i = 0, 10 do
- if grow then
- obj.Size = obj.Size + Vector3.new(1, 1, 1)
- obj.CFrame = oldcf
- end
- obj.Transparency = obj.Transparency + 0.1
- swait()
- end
- if dest then
- obj:Destroy()
- end
- end)
- end
- local keyamount = 0
- mouse.KeyDown:connect(function(key)
- if key == "w" or key == "a" or key == "s" or key == "d" then
- keyamount = keyamount + 1
- if animpose ~= "Falling" then
- if keyamount > 3 then
- keyamount = 0
- end
- animpose = "Walking"
- end
- end
- end)
- mouse.KeyUp:connect(function(key)
- if key == "w" or key == "a" or key == "s" or key == "d" then
- keyamount = keyamount - 1
- if keyamount < 0 then
- keyamount = 0
- end
- if keyamount == 0 then
- animpose = "Idle"
- end
- end
- end)
- local gun = Instance.new("Part")
- gun.Size = Vector3.new(3.175, 1.916, 0.465)
- gun.CanCollide = false
- local m = Instance.new("SpecialMesh", gun)
- m.MeshId = "rbxassetid://468351345"
- m.TextureId = "rbxassetid://468351348"
- m.Scale = Vector3.new(0.1, 0.1, 0.1)
- gun.CFrame = char.Torso.CFrame
- gun.Parent = char
- local gunw = Instance.new("Weld", gun)
- gunw.Part0 = gun
- gunw.Part1 = char["Right Arm"]
- gunw.C0 = CFrame.new(-1.7838248, -0.410839319, 0, -0.0871557146, -0.996194541, 0, 0.996194541, -0.0871557146, 0, 0, 0, 1)
- mouse.Button1Down:connect(function()
- local cf = gun.CFrame * CFrame.new(0, 0, 0.958)
- local mag = (gun.Position - mouse.Hit.p).magnitude
- local p = Instance.new("Part")
- p.CanCollide = false
- p.Anchored = false
- p.BrickColor = BrickColor.random()
- p.Size = Vector3.new(0.2, 0.2, mag)
- smooth(p)
- p.Material = "Neon"
- p.CFrame = CFrame.new(gun.Position, mouse.Hit.p) * CFrame.new(0, 0, -mag / 2)
- local m = Instance.new("SpecialMesh", p)
- m.MeshType = "Brick"
- p.Parent = workspace
- p.Touched:connect(function(hit)
- hurt(hit, "Kill")
- if hit.Size.X > 100 and 100 < hit.Size.Z and hit.Size.Y < 3 then
- elseif hit.Parent and hit.Parent.Name ~= plr.Name then
- fade(hit, true)
- end
- end)
- local bp = Instance.new("BodyPosition", p)
- bp.MaxForce = huge
- bp.Position = p.Position
- local saved = p.CFrame
- for i = 1, 10 do
- p.Size = p.Size + Vector3.new(0.01, 0.01, 0.01)
- p.CFrame = saved
- p.Velocity = Vector3.new(0, 0, 100)
- p.Transparency = p.Transparency + 0.1
- wait()
- end
- p:Destroy()
- end)
- mouse.KeyDown:connect(function(key)
- if key == "l" then
- function a(b)
- pcall(function()
- for i, v in pairs(b:children()) do
- pcall(function()
- if v:IsA("BasePart") and v.Parent and v.Parent.Name == "WafflesAreVeryGood" and v.Anchored then
- v.Anchored = false
- end
- if v:IsA("Sound") and v.Parent.Name ~= "WafflesAreVeryGood" then
- v:Destroy()
- end
- if v:IsA("ParticleEmitter") then
- v:Destroy()
- end
- a(v)
- end)
- end
- end)
- end
- a(game)
- end
- if key == "q" then
- local cf = gun.CFrame * CFrame.new(0, 0, 0.958)
- local mag = (gun.Position - mouse.Hit.p).magnitude
- local p = Instance.new("Part")
- p.CanCollide = false
- p.Anchored = false
- p.BrickColor = BrickColor.new("Really red")
- p.Size = Vector3.new(0.2, 0.2, mag)
- smooth(p)
- p.Material = "Neon"
- p.CFrame = CFrame.new(gun.Position, mouse.Hit.p) * CFrame.new(0, 0, -mag / 2)
- local m = Instance.new("SpecialMesh", p)
- m.MeshType = "Brick"
- p.Parent = workspace
- p.Touched:connect(function(hit)
- if gethum(hit) then
- for i, v in pairs(hit.Parent:children()) do
- if v:IsA("Model") then
- v:BreakJoints()
- end
- local ok = false
- for i, e in pairs({
- "Right Arm",
- "Left Arm",
- "Right Leg",
- "Left Leg",
- "Head",
- "Torso",
- "HumanoidRootPart"
- }) do
- if v.Name == e then
- ok = true
- end
- end
- if v:IsA("BasePart") and not ok then
- fade(v, true)
- end
- end
- end
- if hit:FindFirstChildOfClass("TouchTransmitter") then
- hit:FindFirstChildOfClass("TouchTransmitter"):Destroy()
- end
- end)
- local bp = Instance.new("BodyPosition", p)
- bp.MaxForce = huge
- bp.Position = p.Position
- local saved = p.CFrame
- for i = 1, 10 do
- p.Size = p.Size + Vector3.new(0.01, 0.01, 0.01)
- p.CFrame = saved
- p.Velocity = Vector3.new(0, 0, 100)
- p.Transparency = p.Transparency + 0.1
- wait()
- end
- p:Destroy()
- end
- if key == "e" then
- local cf = gun.CFrame * CFrame.new(0, 0, 0.958)
- local mag = (gun.Position - mouse.Hit.p).magnitude
- local p = Instance.new("Part")
- p.CanCollide = false
- p.Anchored = false
- p.BrickColor = BrickColor.new("New Yeller")
- p.Size = Vector3.new(0.2, 0.2, mag)
- smooth(p)
- p.Material = "Neon"
- p.CFrame = CFrame.new(gun.Position, mouse.Hit.p) * CFrame.new(0, 0, -mag / 2)
- local m = Instance.new("SpecialMesh", p)
- m.MeshType = "Brick"
- p.Parent = workspace
- p.Touched:connect(function(hit)
- if gethum(hit) then
- local target = game.Players:FindFirstChild(hit.Parent.Name)
- if target then
- KICK(target)
- end
- end
- end)
- local bp = Instance.new("BodyPosition", p)
- bp.MaxForce = huge
- bp.Position = p.Position
- local saved = p.CFrame
- for i = 1, 10 do
- p.Size = p.Size + Vector3.new(0.01, 0.01, 0.01)
- p.CFrame = saved
- p.Velocity = Vector3.new(0, 0, 100)
- p.Transparency = p.Transparency + 0.1
- wait()
- end
- p:Destroy()
- end
- if key == "r" then
- local cf = gun.CFrame * CFrame.new(0, 0, 0.958)
- local mag = (gun.Position - mouse.Hit.p).magnitude
- local p = Instance.new("Part")
- p.CanCollide = false
- p.Anchored = false
- p.BrickColor = BrickColor.new("Lime green")
- p.Size = Vector3.new(0.2, 0.2, mag)
- smooth(p)
- p.Material = "Neon"
- p.CFrame = CFrame.new(gun.Position, mouse.Hit.p) * CFrame.new(0, 0, -mag / 2)
- local m = Instance.new("SpecialMesh", p)
- m.MeshType = "Brick"
- p.Parent = workspace
- p.Touched:connect(function(hit)
- local hum = gethum(hit)
- if hum then
- hum.Health = hum.MaxHealth
- end
- end)
- local bp = Instance.new("BodyPosition", p)
- bp.MaxForce = huge
- bp.Position = p.Position
- local saved = p.CFrame
- for i = 1, 10 do
- p.Size = p.Size + Vector3.new(0.01, 0.01, 0.01)
- p.CFrame = saved
- p.Velocity = Vector3.new(0, 0, 100)
- p.Transparency = p.Transparency + 0.1
- wait()
- end
- p:Destroy()
- end
- end)
- game:GetService("RunService").Stepped:connect(function()
- local x, z
- local dir = CFrame.new(char.HumanoidRootPart.Position, mouse.Hit.p).lookVector
- x = dir.X
- z = dir.Z
- local cf = CFrame.new(char.HumanoidRootPart.Position, char.HumanoidRootPart.Position + Vector3.new(x, 0, z))
- char.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame:Lerp(cf, 0.5)
- humanoid.AutoRotate = false
- end)
- while wait() do
- if animpose == "Walking" and cananim and legs then
- for i = 0, 0.7, 0.1 do
- if animpose == "Walking" and cananim and legs then
- ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.104528472, -0.994522035, 0, 0.994522035, 0.104528472, 1, 0, 0), 0.2)
- rs.C0 = rs.C0:Lerp(CFrame.new(1.54167628, 0.0454798974, 0, -0.482965499, -0.871292651, -0.087155737, -0.0422539636, -0.0762281716, 0.996195912, -0.874620378, 0.484809875, 0), 0.2)
- neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -0.500000656, -0.866026223, 0, -1.61309954E-9, 9.31323796E-10, 1.00000024, -0.866026342, 0.500000715, -1.86264515E-9), 0.2)
- rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.469472021, 0.882948279, 0, 0, 0, 1, 0.882948279, 0.469472021, 0), 0.2)
- lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -0.0219629817, 0.02712203, -0.999390841, -0.628937364, 0.776673257, 0.0348994955, 0.777146697, 0.6293208, 0), 0.4)
- rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, 0.0238014236, -0.0255239103, 0.999390841, -0.681583524, 0.73090899, 0.0348994955, -0.731354535, -0.681998909, 0), 0.4)
- wait()
- else
- break
- end
- end
- for i = 0, 0.7, 0.1 do
- if animpose == "Walking" and cananim and legs then
- ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.104528472, -0.994522035, 0, 0.994522035, 0.104528472, 1, 0, 0), 0.2)
- rs.C0 = rs.C0:Lerp(CFrame.new(1.54167628, 0.0454798974, 0, -0.482965499, -0.871292651, -0.087155737, -0.0422539636, -0.0762281716, 0.996195912, -0.874620378, 0.484809875, 0), 0.2)
- neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -0.500000656, -0.866026223, 0, -1.61309954E-9, 9.31323796E-10, 1.00000024, -0.866026342, 0.500000715, -1.86264515E-9), 0.2)
- rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.469472021, 0.882948279, 0, 0, 0, 1, 0.882948279, 0.469472021, 0), 0.2)
- lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, 0.0205134545, 0.0282343514, -0.999390841, 0.587428331, 0.808525503, 0.0348994955, 0.809018135, -0.587786257, 0), 0.4)
- rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -0.0224330258, -0.0267346334, 0.999390841, 0.642397523, 0.765579402, 0.0348994955, -0.76604569, 0.642788768, 0), 0.4)
- wait()
- else
- break
- end
- end
- end
- if animpose == "Idle" and cananim and legs then
- ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.104528472, -0.994522035, 0, 0.994522035, 0.104528472, 1, 0, 0), 0.2)
- rs.C0 = rs.C0:Lerp(CFrame.new(1.54167628, 0.0454798974, 0, -0.482965499, -0.871292651, -0.087155737, -0.0422539636, -0.0762281716, 0.996195912, -0.874620378, 0.484809875, 0), 0.2)
- neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -0.500000656, -0.866026223, 0, -1.61309954E-9, 9.31323796E-10, 1.00000024, -0.866026342, 0.500000715, -1.86264515E-9), 0.2)
- rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.469472021, 0.882948279, 0, 0, 0, 1, 0.882948279, 0.469472021, 0), 0.2)
- lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, 0, 0.0523359552, -0.99862957, 0, 0.99862957, 0.0523359552, 1, 0, 0), 0.5)
- rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, 0, -0.0523359627, 0.998629689, 0, 0.998629689, 0.0523359627, -1, 0, 0), 0.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement