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 Mokiros")
- 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
- -- Double Boost Recreation by Theamazingnater
- plr = game.Players.LocalPlayer
- repeat wait() until plr.Character
- char = plr.Character
- mouse = plr:GetMouse()
- wait(1)
- local neck = Instance.new("Weld",char)
- neck.Part0 = char.Torso
- neck.Part1 = char.Head
- neck.C0 = CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- local humanroot = Instance.new("Weld",char)
- humanroot.Name = "HumanoidRoot"
- humanroot.Part0 = char.HumanoidRootPart
- humanroot.Part1 = char.Torso
- local rhandclone = game.Players.LocalPlayer.Character.Torso["Right Shoulder"]:Clone()
- local rhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
- rhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
- rhandweld.Part1 = game.Players.LocalPlayer.Character["Right Arm"]
- rhandweld.C0 = CFrame.new(0, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
- local lhandclone = game.Players.LocalPlayer.Character.Torso["Left Shoulder"]:Clone()
- local lhandweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
- lhandweld.Part0 = game.Players.LocalPlayer.Character.Torso
- lhandweld.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
- lhandweld.C0 = CFrame.new(0, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
- local llegweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
- llegweld.Part0 = game.Players.LocalPlayer.Character.Torso
- llegweld.Part1 = game.Players.LocalPlayer.Character["Left Leg"]
- llegweld.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.new(0,-1,0)
- local rlegclone = game.Players.LocalPlayer.Character.Torso["Right Hip"]:Clone()
- game.Players.LocalPlayer.Character.Torso["Right Hip"]:Remove()
- local rlegweld = Instance.new("Weld", game.Players.LocalPlayer.Character.Torso)
- rlegweld.Part0 = game.Players.LocalPlayer.Character.Torso
- rlegweld.Part1 = game.Players.LocalPlayer.Character["Right Leg"]
- rlegweld.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.new(0,-1,0)
- for i = 0,1 ,0.03 do
- humanroot.C0 = humanroot.C0:lerp(CFrame.new(0, 0, 0, 1, 0, 0, 0, 0.861433148, -0.507871091, 0, 0.507871091, 0.861433148):inverse(),i)
- lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.0847580433, -0.504649997, 1, 0, 0, 0, 0.826165259, -0.563427925, 0, 0.563427925, 0.826165259),i)
- llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.9787972, -0.643271148, 0, 0, -1, -0.519508898, 0.854465187, 0, 0.854465187, 0.519508898, 0),i)
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.0881803036, -0.315132141, 1, 0, 0, 0, 0.840211272, -0.542259157, 0, 0.542259157, 0.840211272),i)
- rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.95825088, -0.666816115, 0, 0, 1, 0.529378891, 0.848385572, 0, -0.848385572, 0.529378891, 0),i)
- neck.C0 = neck.C0:lerp(CFrame.new(0, 1.39824653, 0.172113657, 1, 0, 0, 0, 0.860818028, -0.50891304, 0, 0.50891304, 0.860818028),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- local SCREENGUI = Instance.new("ScreenGui",plr.PlayerGui)
- local IMAGE = Instance.new("ImageButton",SCREENGUI)
- IMAGE.Image = "rbxassetid://39637251"
- IMAGE.Size = UDim2.new(0.228, 0,0.154, 0)
- IMAGE.Position = UDim2.new(0.368, 0,0.534, 0)
- IMAGE.BackgroundTransparency = 1
- IMAGE.BorderSizePixel = 0
- SpinDashCharge = Instance.new("Sound",char)
- SpinDashCharge.SoundId = "rbxassetid://301022165"
- SpinDashCharge.Volume = 4
- Boost = Instance.new("Sound",char)
- Boost.SoundId = "rbxassetid://2698534079"
- Boost.Volume = 6
- Boost.Looped = true
- Boost:Play()
- Charge = 0
- char.Humanoid.JumpPower = 0
- Pressed = false
- function ChargeBoost()
- Charge = Charge + 5
- SpinDashCharge:Play()
- end
- game:GetService("UserInputService").InputBegan:Connect(function(key)
- if key.UserInputType == Enum.UserInputType.Keyboard then
- if key.KeyCode == Enum.KeyCode.Space and SCREENGUI.Parent ~= nil then
- ChargeBoost()
- Pressed = true
- end
- end
- end)
- wait(5)
- SCREENGUI.Parent = nil
- char.Humanoid.WalkSpeed = 1 + Charge
- char.Humanoid.JumpPower = 50
- BoostColor = BrickColor.new("Pink")
- if Pressed == false then
- char.Humanoid.WalkSpeed = 150
- end
- local trail = Instance.new("Trail",char)
- trail.Attachment0 = char.Head.FaceCenterAttachment
- trail.Attachment1 = char.HumanoidRootPart.RootAttachment
- trail.Color = ColorSequence.new(BoostColor.Color)
- trail.MaxLength = 0
- trail.Lifetime = 0.2
- local pose = "Standing"
- char.Torso.Touched:connect(function(part)
- local hum = part.Parent:FindFirstChildOfClass("Humanoid")
- if hum and pose == "Walking" then
- hum.Health = 0
- else
- hum.Health = 100
- end
- end)
- local chara = workspace:WaitForChild(plr.Name)
- local human = chara.Humanoid
- local speed = 0
- human.Running:connect(function(s)
- speed = s
- end)
- cananimate = true
- local update = game:GetService("RunService")
- update.RenderStepped:connect(function()
- local ray = Ray.new(chara.Torso.Position, (chara.Torso.Position - Vector3.new(0,9999999,0)).unit * 300)
- local p, position = game.Workspace:FindPartOnRay(ray, char, true, false)
- local dis = (chara.Torso.Position - position).magnitude
- if dis > 3.8 and chara.Torso.Velocity.Y > 0 then
- pose = "Jumping"
- end
- if dis> 3.8 and chara.Torso.Velocity.Y < 0 then
- pose = "Falling"
- end
- if dis < 3.8 and speed == 0 then
- pose = "Standing"
- end
- if dis < 3.8 and speed > 0 then
- pose = "Walking"
- end
- end)
- while true do
- wait()
- if pose == "Standing" and cananimate then
- for i = 0,1 ,0.03 do
- humanroot.C0 = humanroot.C0:lerp(CFrame.new(0, 0, 0, 1, 0, 0, 0, 0.861433148, -0.507871091, 0, 0.507871091, 0.861433148):inverse(),i)
- lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.0847580433, -0.504649997, 1, 0, 0, 0, 0.826165259, -0.563427925, 0, 0.563427925, 0.826165259),i)
- llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.9787972, -0.643271148, 0, 0, -1, -0.519508898, 0.854465187, 0, 0.854465187, 0.519508898, 0),i)
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.0881803036, -0.315132141, 1, 0, 0, 0, 0.840211272, -0.542259157, 0, 0.542259157, 0.840211272),i)
- rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.95825088, -0.666816115, 0, 0, 1, 0.529378891, 0.848385572, 0, -0.848385572, 0.529378891, 0),i)
- neck.C0 = neck.C0:lerp(CFrame.new(0, 1.39824653, 0.172113657, 1, 0, 0, 0, 0.860818028, -0.50891304, 0, 0.50891304, 0.860818028),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- end
- if pose == "Walking" and cananimate then
- for i = 0,1 , 0.3 do
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.49999845, 0.0116631985, 0.62646699, 1.00000012, 3.50177288e-07, -2.71806493e-06, 2.0340085e-06, 0.568486691, 0.822692573, 1.83284283e-06, -0.822692692, 0.568486571),i)
- rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.50001049, -1.33467507, -1.34572363, 1.00135803e-05, -5.93066216e-06, 1.00000012, 0.95380795, 0.300417304, -7.76350498e-06, -0.300417483, 0.95380795, 8.65757465e-06),i)
- llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -2.06321907, 0.382456064, 1.89989805e-07, 2.23517418e-07, -1.00000012, 0.324321806, 0.945946872, 2.71946192e-07, 0.945946872, -0.324321896, 1.11758709e-07),i)
- lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.50000167, 0.160489321, 0.409729481, 1.00000012, 3.7252903e-07, -2.71759927e-06, 2.0340085e-06, 0.565193176, 0.824958682, 1.83284283e-06, -0.824958742, 0.565193117),i)
- game:GetService("RunService").RenderStepped:wait()
- end
- for i = 0,1 , 0.3 do
- llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.500000715, -1.4970336, -1.30027473, 2.85357237e-06, -1.40443444e-06, -1.00000012, -0.956139505, 0.292911917, -3.14414501e-06, 0.292912006, 0.956139505, -4.991889e-07),i)
- rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.499979883, -1.99265182, 0.346698284, 1.71288848e-05, 6.40004873e-06, 1.00000012, -0.34762764, 0.93763268, -4.09781933e-08, -0.937632799, -0.34762764, 1.82762742e-05),i)
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.49999845, 0.0116631985, 0.62646699, 1.00000012, 3.50177288e-07, -2.71806493e-06, 2.0340085e-06, 0.568486691, 0.822692573, 1.83284283e-06, -0.822692692, 0.568486571),i)
- lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.50000167, 0.160489321, 0.409729481, 1.00000012, 3.7252903e-07, -2.71759927e-06, 2.0340085e-06, 0.565193176, 0.824958682, 1.83284283e-06, -0.824958742, 0.565193117),i)
- end
- end
- if pose == "Jumping" and cananimate then
- for i = 0,1 , 0.05 do
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.999999285, 0.000862598419, 1, 0, 0, 0, -0.99999845, 0.00172528333, 0, -0.00172528345, -0.99999851),i)
- lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.999960184, -0.00631046295, 1, 0, 0, 0, -0.999920309, -0.0126213925, 0, 0.0126213934, -0.999920368),i)
- llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.99999988, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1),i)
- rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.99999988, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1),i)
- update.RenderStepped:wait()
- end
- end
- if pose == "Falling" and cananimate then
- for i = 0,1 , 0.05 do
- rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.999999285, 0.000862598419, 1, 0, 0, 0, -0.99999845, 0.00172528333, 0, -0.00172528345, -0.99999851),i)
- lhandweld.C0 = lhandweld.C0:lerp(CFrame.new(-1.5, 0.999960184, -0.00631046295, 1, 0, 0, 0, -0.999920309, -0.0126213925, 0, 0.0126213934, -0.999920368),i)
- llegweld.C0 = llegweld.C0:lerp(CFrame.new(-0.5, -1.99999988, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1),i)
- rlegweld.C0 = rlegweld.C0:lerp(CFrame.new(0.5, -1.99999988, 0, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1),i)
- update.RenderStepped:wait()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement