Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NLS([[
- local power = 1
- owner.Chatted:Connect(function(msg)
- if msg:sub(1,7) == "-power " then
- power = msg:sub(7,#msg)
- end
- end)
- local donthit = {}
- for i,v in pairs(owner.Character:GetDescendants()) do
- pcall(function()
- table.insert(donthit,v)
- end)
- end
- for i,v in pairs(workspace:GetDescendants()) do
- pcall(function()
- if v.CanCollide == false then
- table.insert(donthit,v)
- end
- end)
- end
- jump = false
- local Speed = 0
- speed2 = 16
- local rotspeed = 0
- local rotspeed2 = 0
- local mouse = owner:GetMouse()
- local uis = game:GetService("UserInputService")
- local animationTrack = owner.Character.Humanoid:LoadAnimation(owner.Character.Animate.walk.WalkAnim)
- animationTrack.Looped = true
- animationTrack.Priority = Enum.AnimationPriority.Movement
- local animationTrack3 = owner.Character.Humanoid:LoadAnimation(owner.Character.Animate.jump.JumpAnim)
- animationTrack3.Priority = Enum.AnimationPriority.Movement
- LastAttack = 0
- uis.InputBegan:Connect(function(input)
- input = input.KeyCode
- if input == Enum.KeyCode.W then
- Speed = 1
- animationTrack:Play()
- local Tick = game:GetService("RunService").Stepped:wait()
- if (Tick - LastAttack) < 1.5 then
- speed2 = 20
- else
- speed2 = 16
- end
- LastAttack = Tick
- for i,v in pairs(owner.Character:GetDescendants()) do
- pcall(function()
- if v.Name ~= "HumanoidRootPart" then
- local density = 0
- local friction = 0
- local elasticity = 0
- local frictionWeight = 100000000000
- local elasticityWeight = 0
- local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
- v.CustomPhysicalProperties = physProperties
- end
- end)
- end
- elseif input == Enum.KeyCode.A then
- rotspeed = 1
- rotspeed2 = 0
- elseif input == Enum.KeyCode.S then
- Speed = -1
- animationTrack:Play()
- for i,v in pairs(owner.Character:GetDescendants()) do
- pcall(function()
- if v.Name ~= "HumanoidRootPart" then
- local density = 0
- local friction = 0
- local elasticity = 0
- local frictionWeight = 100000000000
- local elasticityWeight = 0
- local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
- v.CustomPhysicalProperties = physProperties
- end
- end)
- end
- elseif input == Enum.KeyCode.D then
- rotspeed = -1
- rotspeed2 = 0
- elseif input == Enum.KeyCode.Space then
- animationTrack3:Play()
- jump = true
- wait(0.25)
- jump = false
- end
- end)
- uis.InputEnded:Connect(function(input)
- input = input.KeyCode
- if input == Enum.KeyCode.W then
- Speed = 0
- animationTrack:Stop()
- for i,v in pairs(owner.Character:GetDescendants()) do
- pcall(function()
- if v.Name ~= "HumanoidRootPart" then
- local density = 0
- local friction = 0
- local elasticity = 0
- local frictionWeight = 100000000000
- local elasticityWeight = 0
- local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
- v.CustomPhysicalProperties = physProperties
- end
- end)
- end
- elseif input == Enum.KeyCode.A then
- rotspeed =0
- rotspeed2 = 0
- elseif input == Enum.KeyCode.D then
- rotspeed =0
- rotspeed2 = 0
- elseif input == Enum.KeyCode.S then
- Speed = 0
- animationTrack:Stop()
- for i,v in pairs(owner.Character:GetDescendants()) do
- pcall(function()
- if v.Name ~= "HumanoidRootPart" then
- local density = 0
- local friction = 0
- local elasticity = 0
- local frictionWeight = 100000000000
- local elasticityWeight = 0
- local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
- v.CustomPhysicalProperties = physProperties
- end
- end)
- end
- end
- end)
- local jumpp = Instance.new("NumberValue")
- jumpp.Value = -15
- block = owner.Character.HumanoidRootPart
- local xzGyro = Instance.new("BodyGyro")
- xzGyro.MaxTorque = Vector3.new(100000,0,100000)
- xzGyro.P = 100000
- xzGyro.D = 2500
- xzGyro.Parent = owner.Character.HumanoidRootPart
- game:GetService("RunService").RenderStepped:Connect(function()
- block.Velocity = block.CFrame.LookVector * Speed * speed2
- block.AssemblyAngularVelocity = block.CFrame.UpVector * rotspeed * 5
- end)
- local bf = Instance.new("BodyForce", owner.Character.HumanoidRootPart)
- local bf2 = Instance.new("BodyVelocity", owner.Character.HumanoidRootPart)
- bf2.MaxForce = Vector3.new(0,750,0)
- bf2.Velocity = Vector3.new()
- pcall(function()
- game:GetService("RunService").RenderStepped:Connect(function()
- if jump then
- jumpp.Value = 15 * power
- bf.Force = block.CFrame.upVector * workspace.Gravity * block:GetMass() * jumpp.Value
- elseif not jump then
- local tweenService = game:GetService("TweenService")
- local timeToFade = .125
- local object = jumpp
- local tweenInfo = TweenInfo.new(timeToFade)
- local goal = {}
- goal.Value = -30 * power
- local tween = tweenService:Create(object, tweenInfo, goal)
- tween:Play()
- bf.Force = block.CFrame.upVector * workspace.Gravity * block:GetMass() * jumpp.Value
- end
- local params = RaycastParams.new()
- params.FilterDescendantsInstances = {block, owner.Character,donthit}
- params.FilterType = Enum.RaycastFilterType.Blacklist
- local result = workspace:Raycast(block.Position, block.CFrame.upVector * -10 + block.CFrame.lookVector * 5, params)
- local result2 = workspace:Raycast(block.Position, block.CFrame.upVector * 10 + block.CFrame.lookVector * 5, params)
- local result3 = workspace:Raycast(block.Position, block.CFrame.upVector * 10, params)
- local result4 = workspace:Raycast(block.Position, block.CFrame.upVector * -10 + block.CFrame.lookVector * -5, params)
- local result5 = workspace:Raycast(block.Position, block.CFrame.upVector * 10 + block.CFrame.lookVector * -5, params)
- local result6 = workspace:Raycast(block.Position, block.CFrame.upVector * -10, params)
- if (result) then
- local currentRightVector = block.CFrame.RightVector
- local upVector = result.Normal
- local newFacialVector = currentRightVector:Cross(upVector)
- xzGyro.CFrame = CFrame.fromMatrix(block.Position, currentRightVector, upVector, newFacialVector)
- elseif (result2) then
- local currentRightVector = block.CFrame.RightVector
- local upVector = result2.Normal
- local newFacialVector = currentRightVector:Cross(upVector)
- xzGyro.CFrame = CFrame.fromMatrix(block.Position, currentRightVector, upVector, newFacialVector)
- elseif (result3) then
- local currentRightVector = block.CFrame.RightVector
- local upVector = result3.Normal
- local newFacialVector = currentRightVector:Cross(upVector)
- xzGyro.CFrame = CFrame.fromMatrix(block.Position, currentRightVector, upVector, newFacialVector)
- elseif (result4) then
- local currentRightVector = block.CFrame.RightVector
- local upVector = result4.Normal
- local newFacialVector = currentRightVector:Cross(upVector)
- xzGyro.CFrame = CFrame.fromMatrix(block.Position, currentRightVector, upVector, newFacialVector)
- elseif (result5) then
- local currentRightVector = block.CFrame.RightVector
- local upVector = result5.Normal
- local newFacialVector = currentRightVector:Cross(upVector)
- xzGyro.CFrame = CFrame.fromMatrix(block.Position, currentRightVector, upVector, newFacialVector)
- elseif (result6) then
- local currentRightVector = block.CFrame.RightVector
- local upVector = result6.Normal
- local newFacialVector = currentRightVector:Cross(upVector)
- xzGyro.CFrame = CFrame.fromMatrix(block.Position, currentRightVector, upVector, newFacialVector)
- end
- end)
- end)
- owner.Character.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
- ]], owner.PlayerGui)
Add Comment
Please, Sign In to add comment