Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- LocalScript0 = Instance.new("LocalScript")
- Sound1 = Instance.new("Sound")
- LocalScript2 = Instance.new("LocalScript")
- ParticleEmitter3 = Instance.new("ParticleEmitter")
- Animation4 = Instance.new("Animation")
- LocalScript0.Name = "Rocket Boots"
- LocalScript0.Parent = mas
- table.insert(cors,sandbox(LocalScript0,function()
- --Made by Luckymaxer
- wait(1)
- Player = game.Players.LocalPlayer
- Character = Player.Character
- Humanoid = Character:FindFirstChild("Humanoid")
- Torso = Character:FindFirstChild("Torso")
- Tool = script.Parent
- Players = game:GetService("Players")
- Debris = game:GetService("Debris")
- Animations = {
- Pose = {Animation = script:WaitForChild("Pose"), FadeTime = nil, Weight = nil, Speed = nil}
- }
- Flying = false
- ServerControl = (script:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
- ServerControl.Name = "ServerControl"
- ServerControl.Parent = script
- ClientControl = (script:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
- ClientControl.Name = "ClientControl"
- ClientControl.Parent = script
- function GetTotalMass(Parent)
- TotalMass = 0
- function GetMass(Parent)
- for i, v in pairs(Parent:GetChildren()) do
- if v:IsA("BasePart") then
- TotalMass = TotalMass + v:GetMass()
- end
- GetMass(v)
- end
- end
- GetMass(Parent)
- return TotalMass
- end
- function CheckIfAlive()
- return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
- end
- function OnServerInvoke(player, mode, value)
- if player ~= Player or not CheckIfAlive() then
- return
- end
- if mode == "Flying" and value then
- local Mode = value.Flying
- if Mode then
- Flying = true
- else
- Flying = false
- end
- end
- end
- function InvokeClient(Mode, Value)
- local ClientReturn = nil
- pcall(function()
- ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
- end)
- return ClientReturn
- end
- ServerControl.OnServerInvoke = OnServerInvoke
- end))
- Sound1.Name = "Wind"
- Sound1.Parent = LocalScript0
- Sound1.Looped = true
- Sound1.EmitterSize = 0
- Sound1.MinDistance = 0
- Sound1.SoundId = "http://www.roblox.com/asset?id=97179333"
- Sound1.Volume = 4
- LocalScript2.Parent = LocalScript0
- table.insert(cors,sandbox(LocalScript2,function()
- --Made by Luckymaxer
- wait(1)
- function EquipWings()
- lboot=Instance.new('Part')
- lboot.Transparency=1
- lboot.FormFactor=Enum.FormFactor.Custom
- lboot.CanCollide=false
- lboot.Size=Vector3.new(0,0,0)
- lboot.CFrame=Character['Left Leg'].CFrame+Vector3.new(0,-1.2,0)
- f=script.Fire:Clone()
- f.Parent=lboot
- lw=Instance.new('Weld')
- lw.Part0=lboot
- lw.Part1=Character['Left Leg']
- lw.Parent=lboot
- lw.C0=lboot.CFrame:inverse()
- lw.C1=Character['Left Leg'].CFrame:inverse()
- lboot.Parent=Character
- rboot=Instance.new('Part')
- rboot.Transparency=1
- rboot.FormFactor=Enum.FormFactor.Custom
- rboot.CanCollide=false
- rboot.Size=Vector3.new(0,0,0)
- rboot.CFrame=Character['Right Leg'].CFrame+Vector3.new(0,-1.2,0)
- f=script.Fire:Clone()
- f.Parent=rboot
- rw=Instance.new('Weld')
- rw.Part0=rboot
- rw.Part1=Character['Right Leg']
- rw.Parent=rboot
- rw.C0=rboot.CFrame:inverse()
- rw.C1=Character['Right Leg'].CFrame:inverse()
- rboot.Parent=Character
- larm=Instance.new('Part')
- larm.Transparency=1
- larm.FormFactor=Enum.FormFactor.Custom
- larm.CanCollide=false
- larm.Size=Vector3.new(0,0,0)
- larm.CFrame=Character['Left Arm'].CFrame+Vector3.new(0,0,0)
- f=script.Fire:Clone()
- f.Parent=larm
- lw2=Instance.new('Weld')
- lw2.Part0=larm
- lw2.Part1=Character['Left Arm']
- lw2.Parent=larm
- larm.Parent=Character
- rarm=Instance.new('Part')
- rarm.Transparency=1
- rarm.FormFactor=Enum.FormFactor.Custom
- rarm.CanCollide=false
- rarm.Size=Vector3.new(0,0,0)
- rarm.CFrame=Character['Right Arm'].CFrame+Vector3.new(5,0,0)
- f=script.Fire:Clone()
- f.Parent=rarm
- rw2=Instance.new('Weld')
- rw2.Part0=rarm
- rw2.Part1=Character['Right Arm']
- rw2.Parent=rarm
- rarm.Parent=Character
- BodyVelocity = Instance.new("BodyVelocity")
- BodyVelocity.P = (10 ^ 4)
- BodyVelocity.velocity = Vector3.new(0, 0, 0)
- BodyVelocity.maxForce = Vector3.new(0, 0, 0)
- BodyVelocity.Parent = Torso
- BodyGyro = Instance.new("BodyGyro")
- BodyGyro.P = (10 ^ 6)
- BodyGyro.maxTorque = Vector3.new(0, 0, 0)
- BodyGyro.cframe = Torso.CFrame
- BodyGyro.Parent = Torso
- InvokeClient("DisableJump")
- end
- Player = game.Players.LocalPlayer
- Character = Player.Character
- Humanoid = Character:FindFirstChild("Humanoid")
- Torso = Character:FindFirstChild("Torso")
- Tool = script.Parent
- Players = game:GetService("Players")
- Debris = game:GetService("Debris")
- RunService = game:GetService("RunService")
- Camera = game:GetService("Workspace").CurrentCamera
- Animations = {}
- LocalObjects = {}
- Speed = {
- CurrentSpeed = 2,
- MaxSpeed = 185
- }
- Jumping = {
- JumpTick = 0,
- Jumps = 0,
- JumpTime = 0.25,
- JumpsRequired = 2
- }
- Controls = {
- Forward = {Number = 0, Numbers = {On = -1, Off = 0}, Keys = {"W", 17}},
- Backward = {Number = 0, Numbers = { On = 1, Off = 0}, Keys = {"S", 18}},
- Left = {Number = 0, Numbers = {On = -1, Off = 0}, Keys = {"A", 20}},
- Right = {Number = 0, Numbers = {On = 1, Off = 0}, Keys = {"D", 19}}
- }
- UsableAnimations = {
- Pose = {Animation = Tool:WaitForChild("Pose"), FadeTime = nil, Weight = nil, Speed = nil},
- }
- Sounds = {
- Wind = Tool:WaitForChild("Wind"),
- }
- FlyRate = (1 / 40)
- Debounce = false
- Flying = false
- ServerControl = Tool:WaitForChild("ServerControl")
- ClientControl = Tool:WaitForChild("ClientControl")
- function InvokeClient(Mode, Value)
- local ClientReturn = nil
- pcall(function()
- ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
- end)
- return ClientReturn
- end
- function SetAnimation(Mode, Value)
- if Mode == "PlayAnimation" and Value and Humanoid then
- for i, v in pairs(Animations) do
- if v.Animation == Value.Animation then
- v.AnimationTrack:Stop()
- table.remove(Animations, i)
- end
- end
- local AnimationTrack = Humanoid:LoadAnimation(Value.Animation)
- table.insert(Animations, {Animation = Value.Animation, AnimationTrack = AnimationTrack})
- AnimationTrack:Play(Value.FadeTime, Value.Weight, Value.Speed)
- elseif Mode == "StopAnimation" and Value then
- for i, v in pairs(Animations) do
- if v.Animation == Value.Animation then
- v.AnimationTrack:Stop()
- table.remove(Animations, i)
- end
- end
- end
- end
- function DisableJump(Boolean)
- if PreventJump then
- PreventJump:disconnect()
- end
- if Boolean then
- PreventJump = Humanoid.Changed:connect(function(Property)
- if Property == "Jump" then
- Humanoid.Jump = false
- end
- end)
- end
- end
- function Clamp(Number, Min, Max)
- return math.max(math.min(Max, Number), Min)
- end
- function Fly()
- if Flying and Player and Torso and Humanoid and Humanoid.Health > 0 then
- local Momentum = Vector3.new(0, 0, 0)
- local LastMomentum = Vector3.new(0, 0, 0)
- local LastTilt = 0
- local LastFlap = 0
- local CurrentSpeed = Speed.MaxSpeed
- local Inertia = (1 - (Speed.CurrentSpeed / CurrentSpeed))
- Momentum = (Torso.Velocity + (Torso.CFrame.lookVector * 3) + Vector3.new(0, 10, 0))
- Momentum = Vector3.new(Clamp(Momentum.X, -15, 15), Clamp(Momentum.Y, -15, 15), Clamp(Momentum.Z, -15, 15))
- BodyVelocity.maxForce = Vector3.new(1, 1, 1) * (10 ^ 6)
- BodyGyro.maxTorque = Vector3.new(BodyGyro.P, BodyGyro.P, BodyGyro.P)
- BodyGyro.cframe = Torso.CFrame
- Spawn(function()
- InvokeServer("Flying", {Flying = true})
- end)
- SetAnimation("PlayAnimation", UsableAnimations.Pose)
- Humanoid.AutoRotate = false
- while Flying and Torso and Humanoid and Humanoid.Health > 0 do
- if CurrentSpeed ~= Speed.MaxSpeed then
- CurrentSpeed = Speed.MaxSpeed
- Inertia = (1 - (Speed.CurrentSpeed / CurrentSpeed))
- end
- local Direction = Camera.CoordinateFrame:vectorToWorldSpace(Vector3.new(Controls.Left.Number + Controls.Right.Number, math.abs(Controls.Forward.Number) * 0.2, Controls.Forward.Number + Controls.Backward.Number))
- local Movement = Direction * Speed.CurrentSpeed
- Momentum = (Momentum * Inertia) + Movement
- local TotalMomentum = Momentum.magnitude
- if TotalMomentum > CurrentSpeed then
- TotalMomentum = CurrentSpeed
- end
- local Tilt = ((Momentum * Vector3.new(1, 0, 1)).unit:Cross(((LastMomentum * Vector3.new(1, 0, 1)).unit))).y
- local StringTilt = tostring(Tilt)
- if StringTilt == "-1.#IND" or StringTilt == "1.#IND" or Tilt == math.huge or Tilt == -math.huge or StringTilt == tostring(0 / 0) then
- Tilt = 0
- end
- local AbsoluteTilt = math.abs(Tilt)
- if AbsoluteTilt > 0.1 or AbsoluteTilt < 0.09 then
- if math.abs(LastTilt) > 0.0001 then
- Tilt = (LastTilt * 0.9)
- else
- Tilt = 0
- end
- else
- Tilt = ((LastTilt * 0.77) + (Tilt * 0.25))
- end
- LastTilt = Tilt
- if TotalMomentum < 0.5 then
- Momentum = Vector3.new(0, 0, 0)
- TotalMomentum = 0
- BodyGyro.cframe = Camera.CoordinateFrame
- else
- BodyGyro.cframe = CFrame.new(Vector3.new(0, 0, 0), Momentum) * CFrame.Angles(0, 0, (Tilt * -20)) * CFrame.Angles((math.pi * -0.5 * (TotalMomentum / CurrentSpeed)), 0, 0)
- end
- local GravityDelta = ((((Momentum * Vector3.new(0, 1, 0)) - Vector3.new(0, -Speed.MaxSpeed, 0)).magnitude / Speed.MaxSpeed) * 0.5)
- if GravityDelta > 0.45 and tick() > LastFlap then
- LastFlap = (tick() + 0.5)
- Spawn(function()
- if not Flying then
- return
- end
- if not Sounds.Wind.IsPlaying then
- Sounds.Wind:Play()
- end
- wait(0.25)
- end)
- elseif GravityDelta <= 0.45 then
- Sounds.Wind:Stop()
- end
- BodyVelocity.velocity = Momentum
- LastMomentum = Momentum
- wait(FlyRate)
- end
- Sounds.Wind:Stop()
- Spawn(function()
- InvokeServer("Flying", {Flying = false})
- end)
- SetAnimation("StopAnimation", UsableAnimations.Pose)
- BodyVelocity.maxForce = Vector3.new(0, 0, 0)
- BodyGyro.maxTorque = Vector3.new(0, 0, 0)
- if CheckIfAlive() then
- Humanoid.AutoRotate = true
- Humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
- end
- end
- end
- function StopFlying()
- Flying = false
- BodyVelocity.maxForce = Vector3.new(0, 0, 0)
- BodyGyro.maxTorque = Vector3.new(0, 0, 0)
- end
- function CheckIfAlive()
- return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
- end
- if not CheckIfAlive() then
- return
- end
- PlayerMouse = Player:GetMouse()
- PlayerMouse.Button1Down:connect(function()
- InvokeServer("MouseClick", {Down = true})
- end)
- PlayerMouse.Button1Up:connect(function()
- InvokeServer("MouseClick", {Down = false})
- end)
- PlayerMouse.KeyDown:connect(function(Key)
- local Key = string.lower(Key)
- local ByteKey = string.byte(Key)
- if ByteKey == string.byte(" ") and not Debounce then
- if Flying then
- StopFlying()
- for i, v in pairs({BodyVelocity, BodyGyro, lboot, rboot, larm, rarm}) do
- if v and v.Parent then
- v:Destroy()
- end
- end
- elseif not Flying then
- if (tick() - Jumping.JumpTick) <= Jumping.JumpTime or Jumping.JumpTick == 0 then
- Jumping.JumpTick = tick()
- Jumping.Jumps = Jumping.Jumps + 1
- if Jumping.Jumps >= Jumping.JumpsRequired then
- Debounce = true
- Jumping.JumpTick = 0
- Jumping.Jumps = 0
- Flying = true
- Spawn(EquipWings)
- Spawn(Fly)
- Debounce = false
- end
- else
- Jumping.JumpTick = tick()
- Jumping.Jumps = 1
- end
- end
- end
- for i, v in pairs(Controls) do
- for ii, vv in pairs(v.Keys) do
- v.Number = ((((string.lower(type(vv)) == string.lower("String") and Key == string.lower(vv)) or (string.lower(type(vv)) == string.lower("Number") and ByteKey == vv)) and v.Numbers.On) or v.Number)
- end
- end
- end)
- PlayerMouse.KeyUp:connect(function(Key)
- local Key = string.lower(Key)
- local ByteKey = string.byte(Key)
- for i, v in pairs(Controls) do
- for ii, vv in pairs(v.Keys) do
- v.Number = ((((string.lower(type(vv)) == string.lower("String") and Key == string.lower(vv)) or (string.lower(type(vv)) == string.lower("Number") and ByteKey == vv)) and v.Numbers.Off) or v.Number)
- end
- end
- end)
- while not BodyVelocity or not BodyVelocity.Parent or not BodyGyro or not BodyGyro.Parent and CheckIfAlive() do
- BodyVelocity = Torso:FindFirstChild("BodyVelocity")
- BodyGyro = Torso:FindFirstChild("BodyGyro")
- RunService.Stepped:wait()
- end
- function InvokeServer(Mode, Value)
- pcall(function()
- local ServerReturn = ServerControl:InvokeServer(Mode, Value)
- return ServerReturn
- end)
- end
- function OnClientInvoke(Mode, Value)
- if Mode == "PlayAnimation" and Value and Humanoid then
- SetAnimation("PlayAnimation", Value)
- elseif Mode == "StopAnimation" and Value then
- SetAnimation("StopAnimation", Value)
- elseif Mode == "PlaySound" and Value then
- Value:Play()
- elseif Mode == "StopSound" and Value then
- Value:Stop()
- elseif Mode == "MousePosition" then
- return PlayerMouse.Hit.p
- elseif Mode == "DisableJump" then
- DisableJump(Value)
- elseif Mode == "Fly" and not Flying then
- Flying = true
- Spawn(function()
- Fly()
- end)
- end
- end
- function InvokeClient(Mode, Value)
- local ClientReturn = nil
- pcall(function()
- ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
- end)
- return ClientReturn
- end
- ClientControl.OnClientInvoke = OnClientInvoke
- end))
- ParticleEmitter3.Name = "Fire"
- ParticleEmitter3.Parent = LocalScript2
- ParticleEmitter3.Speed = NumberRange.new(-5, -5)
- ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.992157, 1, 0.67451),Color3.new(1, 0.658824, 0.321569))
- ParticleEmitter3.LightEmission = 4
- ParticleEmitter3.Texture = "http://www.roblox.com/asset/?id=48229939"
- ParticleEmitter3.Transparency = NumberSequence.new(0.44374999403954,0.89375001192093,0.91874998807907,1)
- ParticleEmitter3.Size = NumberSequence.new(0.60000002384186,0.60000002384186)
- ParticleEmitter3.Lifetime = NumberRange.new(0.30000001192093, 0.30000001192093)
- ParticleEmitter3.LockedToPart = true
- ParticleEmitter3.Rate = 45645648
- Animation4.Name = "Pose"
- Animation4.Parent = LocalScript0
- Animation4.AnimationId = "http://www.roblox.com/Asset?ID=97172005"
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Character
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement