#how do I script a sprint system with animations

1 messages · Page 1 of 1 (latest)

dawn oasis
#

from scratch really cuz I don’t wanna steal from toolbox + I wanna learn

vague flicker
#

do u know anything about variables etc?

#

and functions

#

and Enum.Keycode and stuff

#

main things to help u make this happen

dawn oasis
#

yes I do

#

the only thing is to detect when the player is moving and ensure the animation plays without breaking everything according to the state of the user

#

also whenever i use getstate from the humanoid it keeps printing running instead of being idle

#

any way that I can fix this?

harsh cave
#

Look at context inputs

#

So that when you hold shift it sets the player speed to something and :plays the animation track and then on release it resets the player speed and stops the animation track

#

You don’t even need context inputs you can just do

#

'''

UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end

if input.KeyCode == Enum.KeyCode.shift then
    holding = true
end

end)

-- Detect when the key is released
UserInputService.InputEnded:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.shift then
holding = false
end
end)
'''

#

Sorry on phone so the code might look iffy

vague flicker
#

holy poop script

shell shoal
runic mica
#

Yo

#

Realistically

#

@dawn oasis

#

Check dm

dawn oasis
#

what

#

alr

shell shoal
#

This is not how you should help. You literally sent a script by probably expecting OP to copy & paste / rewrite it dependently which is a big no no. In addition, OP themselves want to write it by themselves, not to get spoon-fed.

TL;DR: We appreciate the effort you’ve put into trying to help OP, but it’s not helping them.

#

@harsh cave

#

I recommend you this tutorial, OP

#

DISCORD 📜
Join my Discord Community if you want scripting help, participate in events/challenges, and make friends!
https://discord.gg/WC6kPu5W5P

MEMBERSHIPS 🎁
Get Access To My Scripts + More Perks By Becoming a Channel Member! 👇
https://www.youtube.com/@BrawlDevRBLX/join

ADVANCED ROBLOX SCRIPTING SERIES 🔴
https://www.youtube.com/p...

▶ Play video
harsh cave
harsh cave
shell shoal
harsh cave
shell shoal
#

It helps much more :)