How to Script SHIFT TO SPRINT (OR DOUBLE TAP W) in Roblox

  Рет қаралды 4,987

script_ing

script_ing

Жыл бұрын

In this video, I teach you guys how to script a shift to sprint script. At the end, I teach you how to make it a double tap to sprint script.

Пікірлер: 39
@uliveulearnandregret
@uliveulearnandregret Жыл бұрын
bro thanks so much, I didn't need the W tap or shift, in a sense I need stamina and max stamina and if it is 0 they are forced to stop sprinting, but on a related not you helped me with tick, so now I can make a combo hit animation based on tick to check if they pressed the attack button before the first animation played then it will play the second animation, think more like fighting games, or games like Let It Die
@DominatorX14
@DominatorX14 Жыл бұрын
After watching 20 videos and trying all the scripts yours was the only one that worked
@scripting
@scripting Жыл бұрын
I’m glad!
@moonshard6900
@moonshard6900 Жыл бұрын
thx for tutorial man
@TheHidden-pw1vj
@TheHidden-pw1vj 11 ай бұрын
For this the useful thing I've Seen
@scripting
@scripting 11 ай бұрын
Glad it was helpful!
@Donpa07
@Donpa07 3 ай бұрын
please make how to zoom in zoom out smoothly or make a script about it. i still dont understand tweenservice or how to script at all
@camronandelean3666
@camronandelean3666 8 ай бұрын
Is there a way to incorporate this into using ContextActionService?
@askshells
@askshells 8 ай бұрын
How does this work tho? because the code says if input.Keycode == Enum.Keycode.W then so surely if they press w then the code would run right? and you wrote "timesincelastwpressed" how do you even know when the last w was pressed, why would it track that?
@scripting
@scripting 8 ай бұрын
As explained in the video, we use tick to figure out when the last time someone pressed W was. We aren’t interested in the time that they pressed W as much as we’re interested in the difference in time (delta time). Let me make this more clear: Suppose you pressed W 2 times. You pressed it the first time, and then you waited 5 seconds, and pressed it the second time. They press it the first time. Let’s say tick() is equal to 100. They waited 5 seconds. They pressed it again. tick() is now equal to 105. So, if you subtract the 2 ticks together, 105-100=5. This tells us that the player pressed W two times with 5 seconds in between. That’s too long for it to begin sprinting. Does this make sense?
@scripting
@scripting 8 ай бұрын
Since 5 seconds is too long, we don’t begin sprinting. But if the difference in tick was smaller, then we know that they pressed it “fast enough” For example, if we subtracted the two ticks and it came out to .5 then they pressed W 2 times with .5 secs of gap
@insomosni
@insomosni Жыл бұрын
Yo man, I modified the script and it didn't work. Can I get get your discord to see if I can get help?
@aaron-pb2lb
@aaron-pb2lb Жыл бұрын
mine dosent work i double checked if i had wrote the script properly and i did could u help me
@RayenTra
@RayenTra Жыл бұрын
Hi wanted to ask what i should do if i wanted to add an animation to that running script :) thank you!
@scripting
@scripting Жыл бұрын
Hi! Look up “humanoid:LoadAnimation” It would be sort of like local animation = Instance.new(“Animation”) animation.AnimationId = 1 - put your id here humanoid:LoadAnimation(animation):Play() - something like this
@RayenTra
@RayenTra Жыл бұрын
@@scripting Ty men great guy
@RayenTra
@RayenTra Жыл бұрын
@@scripting hi again lol (I’m new to scripting and stuff so sorry if I’m acting stupid) It tells me „Unknown global ‚humanoid‘“
@scripting
@scripting Жыл бұрын
That’s because your humanoid is undefined. You’ll want to read up and learn a bit on those concepts (I’m actually working on a giant series on them), but for now- here’s a fix. Put this on the top of your code somewhere local humanoid = game.Players.LocalPlayer.Character.Humanoid This will allow you to access your humanoid. Make sure that it’s on a local script tho or it won’t work
@RayenTra
@RayenTra Жыл бұрын
@@scriptingsorry again. Now it tells me Player.[Username].PlayerScripts.LocalScript:2: attempt to index nil with ‚Humanoid‘
@influXse01
@influXse01 Жыл бұрын
So many code i can write but hard...
@Sonicthespeedster71
@Sonicthespeedster71 10 ай бұрын
maybe pls try putting all the code in the description in the description in your future videos
@scripting
@scripting 10 ай бұрын
Hi! The source code is always available to patrons www.patreon.com/PremiumScripters
@Sonicthespeedster71
@Sonicthespeedster71 10 ай бұрын
@@scripting how do i add an amination to it?
@eridonhasani2392
@eridonhasani2392 8 ай бұрын
how can you add a animation to it?
@goldenollies8338
@goldenollies8338 6 ай бұрын
Animation track (Id) play I think you add a little im new to scripting search a totoriul
@ownedfr0
@ownedfr0 8 ай бұрын
how to do animation while sprinting tho
@scripting
@scripting 8 ай бұрын
Use this How to Script CUSTOM ANIMATIONS in Roblox Studio (BEGINNER FRIENDLY) kzfaq.info/get/bejne/fMCIZMWkqc6qfH0.html
@ownedfr0
@ownedfr0 8 ай бұрын
@@scripting thank you man I’ll definitely try it out 🙏
@thegamercow773
@thegamercow773 6 ай бұрын
PLEASE MAKE A TUTORIAL FOR HOW TO MAKE IT MORE SMOOTH
@scripting
@scripting 6 ай бұрын
What do you mean?
@yourfriendlyskye9493
@yourfriendlyskye9493 6 ай бұрын
@@scripting he means tweening
@GeoxDev
@GeoxDev Жыл бұрын
works to r6?
@rameshchhetri397
@rameshchhetri397 Жыл бұрын
I didn’t understand any of this
@criptx
@criptx Жыл бұрын
wdym?
@Milkguy33
@Milkguy33 Жыл бұрын
need help?
How to SCRIPT a TYPEWRITER TEXT EFFECT on ROBLOX!
8:43
script_ing
Рет қаралды 3,9 М.
Programming Rarity is Harder Than You Think
12:31
ByteBlox
Рет қаралды 169 М.
🤔Какой Орган самый длинный ? #shorts
00:42
Пробую самое сладкое вещество во Вселенной
00:41
버블티로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 112 МЛН
Incredible magic 🤯✨
00:53
America's Got Talent
Рет қаралды 59 МЛН
How To Script Admin Commands in Roblox - /Kill Player
7:39
TheDevLegend
Рет қаралды 2,7 М.
RBLX: How to create a Running Animation R6 / BETTERVERSION
9:29
How to make a SHIFT to SPRINT script - Roblox Studio
3:31
Scriptix
Рет қаралды 48 М.
BEST GUIDE to animating on Roblox for free! [Beginner]
7:36
Pandastroyer
Рет қаралды 250 М.
How to make a Main Menu Gui // 2023 // Roblox Studio
23:45
Asadrith
Рет қаралды 240 М.
Samsung Galaxy 🔥 #shorts  #trending #youtubeshorts  #shortvideo ujjawal4u
0:10
Ujjawal4u. 120k Views . 4 hours ago
Рет қаралды 2,7 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 8 МЛН
Simple maintenance. #leddisplay #ledscreen #ledwall #ledmodule #ledinstallation
0:19
LED Screen Factory-EagerLED
Рет қаралды 27 МЛН