Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uis = game:GetService("UserInputService")
- cg = game:GetService("CoreGui")
- sg = game:GetService("StarterGui")
- wp = game:GetService("Workspace")
- cmr = wp.Camera
- rs = game:GetService("ReplicatedStorage")
- rsd = game:GetService("RunService").RenderStepped
- lgt = game:GetService("Lighting")
- plrs = game:GetService("Players")
- lplr = plrs.LocalPlayer
- mouse = lplr:GetMouse()
- if speedEN == nil then
- speedEN = false
- end
- if _G.speedDash == nil then
- _G.speedDash = 50
- end
- function SendChat(String) -- Send a chat to the game chat
- sg:SetCore(
- "ChatMakeSystemMessage",
- {
- Text = "[OUTPUT]: " .. String
- }
- )
- end
- if tostring(speedEN) == "false" then
- speedEN = true
- down = false
- velocity = Instance.new("BodyVelocity")
- velocity.maxForce = Vector3.new(100000, 0, 100000)
- ---vv Use that to change the speed v
- gyro = Instance.new("BodyGyro")
- gyro.maxTorque = Vector3.new(100000, 0, 100000)
- local hum = lplr.Character.Humanoid
- function onButton1Down(mouse)
- down = true
- if lplr.Character:FindFirstChild("Torso") then
- velocity.Parent = lplr.Character.Torso
- gyro.Parent = lplr.Character.Torso
- else
- velocity.Parent = lplr.Character.UpperTorso
- gyro.Parent = lplr.Character.UpperTorso
- end
- velocity.velocity = (hum.MoveDirection) * _G.speedDash
- while down do
- if not down then
- break
- end
- velocity.velocity = (hum.MoveDirection) * _G.speedDash
- local refpos = gyro.Parent.Position + (gyro.Parent.Position - wp.CurrentCamera.CoordinateFrame.p).unit * 5
- gyro.cframe = CFrame.new(gyro.Parent.Position, Vector3.new(refpos.x, gyro.Parent.Position.y, refpos.z))
- wait(0.1)
- end
- end
- function onButton1Up(mouse)
- velocity.Parent = nil
- gyro.Parent = nil
- down = false
- end
- lplr.CharacterAdded:Connect(
- function(characterModel)
- wait(1)
- velocity = Instance.new("BodyVelocity")
- velocity.maxForce = Vector3.new(100000, 0, 100000)
- ---vv Use that to change the speed v
- gyro = Instance.new("BodyGyro")
- gyro.maxTorque = Vector3.new(100000, 0, 100000)
- local hum = lplr.Character.Humanoid
- function onButton1Down(mouse)
- down = true
- if lplr.Character:FindFirstChild("Torso") then
- velocity.Parent = lplr.Character.Torso
- gyro.Parent = lplr.Character.Torso
- else
- velocity.Parent = lplr.Character.UpperTorso
- gyro.Parent = lplr.Character.UpperTorso
- end
- velocity.velocity = (hum.MoveDirection) * _G.speedDash
- while down do
- if not down then
- break
- end
- velocity.velocity = (hum.MoveDirection) * _G.speedDash
- local refpos =
- gyro.Parent.Position +
- (gyro.Parent.Position - workspace.CurrentCamera.CoordinateFrame.p).unit * 5
- gyro.cframe =
- CFrame.new(gyro.Parent.Position, Vector3.new(refpos.x, gyro.Parent.Position.y, refpos.z))
- wait(0.1)
- end
- end
- function onButton1Up(mouse)
- velocity.Parent = nil
- gyro.Parent = nil
- down = false
- end
- end
- )
- --To Change the key in those 2 lines, replace the "q" with your desired key
- function onSelected(mouse)
- mouse.Button2Down:Connect(
- function()
- if mouse.X / mouse.ViewSizeX == 0.5 then
- onButton1Down(mouse)
- end
- end
- )
- mouse.Button2Up:Connect(
- function()
- if mouse.X / mouse.ViewSizeX == 0.5 then
- onButton1Up(mouse)
- end
- end
- )
- end
- onSelected(lplr:GetMouse())
- end
- function changeDA(typeDA)
- if typeDA == 0 then
- _G.speedDash = _G.speedDash + 5
- elseif typeDA == 1 then
- if _G.speedDash >= 0 then
- _G.speedDash = _G.speedDash - 5
- end
- if _G.speedDash < 0 then
- _G.speedDash = 0
- end
- end
- end
- mouse.KeyDown:connect(
- function(keyDown)
- if keyDown == "[" then
- changeDA(0)
- SendChat("Dash :" .. _G.speedDash)
- end
- if keyDown == "]" then
- changeDA(1)
- SendChat("Dash :" .. _G.speedDash)
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement