Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until game.Players.LocalPlayer.Character
- local Player = game.Players.LocalPlayer
- local UIS = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local CraterEffect = require(game.ReplicatedStorage.CraterEffects)
- local Character = game.Players.LocalPlayer.Character
- local Humanoid = Character.Humanoid
- local Animation = Humanoid:LoadAnimation(script.Idle)
- local FlyAnimation = Humanoid:LoadAnimation(script.Flight)
- local Camera = game.Workspace.CurrentCamera
- local Debs = {false,false}
- local BodyGyro = Instance.new("BodyGyro")
- local BodyVelo = Instance.new("BodyVelocity")
- local Speed = 145
- local Param = RaycastParams.new()
- Param.FilterDescendantsInstances = {Character}
- Param.FilterType = Enum.RaycastFilterType.Blacklist
- local function SPEED(Walk,Jump,Anchored)
- Humanoid.WalkSpeed = Walk
- Humanoid.JumpPower = Jump
- Character.HumanoidRootPart.Anchored = Anchored
- end
- UIS.InputBegan:Connect(function(Input,IsTyping)
- if IsTyping then return end
- if Input.KeyCode == Enum.KeyCode.E then
- if Debs[1] then
- game.ReplicatedStorage.getFireTrans:FireServer()
- Debs[1] = false
- else
- SPEED(0,0,true)
- Animation:Play()
- game.ReplicatedStorage.getFireTrans:FireServer()
- Debs[1] = true
- end
- end
- end)
- UIS.InputEnded:Connect(function(Input,IsTyping)
- if IsTyping then return end
- if Input.KeyCode == Enum.KeyCode.E then
- CraterEffect.new(
- 'Crater', -- This is the type of effect you want
- Character.HumanoidRootPart.CFrame, -- This is the start/center point (depending on the effect)
- {
- ['BlockSize'] = {2,4};
- ['AnimationSpeed'] = .2;
- ['PartCount'] = 15;
- ['Radius'] = 15;
- ['Angle'] = 65;
- ["HoldTime"] = 8;
- }
- )
- SPEED(16,50,false)
- if not Debs[2] then
- FlyAnimation:Play()
- Debs[2] = true
- else
- FlyAnimation:Stop()
- Debs[2] = false
- end
- Animation:Stop()
- BodyVelo.Parent = Character.HumanoidRootPart
- BodyGyro.Parent = Character.HumanoidRootPart
- end
- end)
- RunService.RenderStepped:Connect(function()
- if Debs[2] then
- BodyGyro.MaxTorque = Vector3.new(0,400000,0)
- BodyGyro.D = 100
- BodyGyro.P = 20000
- BodyVelo.MaxForce = Vector3.new(400000,400000,400000)
- local MainRay = workspace:Raycast((Character.HumanoidRootPart.CFrame).p, Vector3.new(0,-10,0),Param)
- if MainRay then
- CraterEffect.new(
- 'Path', -- This is the type of effect you want
- Character.HumanoidRootPart.CFrame, -- This is the start/center point (depending on the effect)
- {
- ['BlockSize'] = {2,4};
- ['AnimationSpeed'] = .2;
- ['PartCount'] = 15;
- ['Angle'] = 65;
- ["HoldTime"] = 5;
- ['stepSize'] = 16;
- ['Width'] = {3,7};
- ["Range"] = 10
- }
- )
- else
- print("Nothing Here")
- end
- local X,Y,Z = Camera.CFrame:ToEulerAnglesXYZ()
- BodyGyro.CFrame = CFrame.Angles(X,Y,Z)
- BodyVelo.Velocity = Camera.CFrame.LookVector * Speed
- task.spawn(function()
- if Speed <= 65 then
- Speed = 65
- else
- Speed -= .5
- print(Speed)
- end
- end)
- else
- BodyVelo.MaxForce = Vector3.new()
- BodyGyro.MaxTorque = Vector3.new()
- BodyGyro.P = 0
- BodyGyro.D = 0
- Speed = 140
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement