Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED BY ME] Is my attempt at making a slide script good?

So I was creating a parkour game, and I was working on a mechanic in which where a player presses Ctrl and the player would 'slide' on the surface while playing the animation.

Here's my attempt at doing so. (LocalScript inside of PlayerGui)

local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild('Humanoid')
uis.InputBegan:Connect(function(keyCode)
	if keyCode.keyCode == Enum.KeyCode.LeftControl or keyCode.keyCode == Enum.KeyCode.RightControl then
		humanoid.WalkToPoint = humanoid.WalkToPoint * Vector3.new(0,-10,0)
		for i = humanoid.WalkSpeed,0,0.5 do
			humanoid.WalkSpeed = i
			wait()
		end
	end
end)
uis.InputBegan:Connect(function(keyCode)
	if keyCode.keyCode == Enum.KeyCode.LeftControl or keyCode.keyCode == Enum.KeyCode.RightControl then
		humanoid.WalkSpeed = 12
	end
end)

The thing is, it works and all, but the speed isn't slowing down...

Can someone at least give me an idea on how I could make/polish this script?

DISCLAIMER: No, I am NOT looking for scripts. I want to see if there's a property that uses some sort of Velocity or something.

EDIT: So I actually found a property inside of a humanoid called PlatformStand. It ragdolls the Character but it gets up pretty good and smooth, unlike Humanoid.Sit. I just slapped in a quick sliding animation and voila! I fixed it in one fell swoop. Thank you for reading this post!

5 comments

0

I'm Also Making A Parkour Game.. Can You Give Me The Animation Pls?

0

@Next_Memer No sorry...

0

Uhh I think its wrong. Maybe try it on a script

0

do you mind if i take this? i only makes games for fun and not for profit

0

how do i implement an animation, i dont need an animation im just wondering

1 answer

Your method works, but the player can easily interrupt the slide because your way of doing it uses the .WalkToPoint property of the player's humanoid, but I think BodyVelocities can be of use here, or maybe TweenService if you're that lazy.

1 comment

0

Yeah this is really old my friend. This was like, last year or something.

This discussion is preserved as it was. New answers, comments, and votes are closed.