#how do I script a sprint system with animations
1 messages · Page 1 of 1 (latest)
do u know anything about variables etc?
and functions
and Enum.Keycode and stuff
main things to help u make this happen
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?
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
holy poop script
🙅🏾♂️🙂↔️
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...
Oh okay, sorry, I just didn’t know how to explain it, but I understand what you mean
I second this, very good vid
Don’t worry, priorise explaining next time
Will do
It helps much more :)