#How do I make it so that the sprint DOESNT stop whenever the game detects ANY input

1 messages · Page 1 of 1 (latest)

fathom wolf
#

I'm pretty new to scripting so this is the only way i could think of going about this
and any time i click or press any other key than w it stops sprinting

#

the screenshot at the top is the missing 11 lines

dim flare
#

I didnt fully understand what ure trying

#

can u explain

#

u want a normal sprinting script or?

fathom wolf
#

huh

#

so basically

#

when i start sprinting

#

whenever i click or press another key WHILE im holding w down

#

my sprint stops

dim flare
#

u wanna make a combat game?

fathom wolf
#

im just testing my ability to script

#

im pretty new to this

dim flare
#

cuz I tried that too

#

but that doesnt work

fathom wolf
#

maybe ill make a few abilities

dim flare
#

I mean

#

when I hold W and then press D

#

Im still runing

#

running*

#

wait lemme just read ur script

fathom wolf
#

i think the problem is how i detect when w is pressed

dim flare
#

but u got no errors

#

right

fathom wolf
#

yeah

#

it works

dim flare
#

ok goo

#

d

#

this line stops

#

put a print under this if statement

#

idk much abt tick() but ur script basically does tick() - 0

#

which is not smaller than timeLimit

fathom wolf
#

so what do i need to do

dim flare
#

wait im checking

#

correct me if im wrong with the tick

#

cuz I dont know anything abt tick()

fathom wolf
#

ill switch tick() with time() since tick() probably has more issues

stoic lanternBOT
#

studio** You are now Level 5! **studio

dim flare
#

yk whats funny

#

when I hold LeftShit

#

nothing works

#

like the custom shiftlock u made doesnt work then

#

but when I change to Q it works

fathom wolf
#

?

#

weird

dim flare
#

yea

#

wait let me check my script

#

cuz if I hold down W it works fine

#

so uh

#
    if input.KeyCode == Enum.KeyCode.W and not gme then
        if Sprint == true then return end        

        Sprint = true
        Humanoid.WalkSpeed += Speed
    end
end)


UserInputService.InputEnded:Connect(function(input,gme)
    if input.KeyCode == Enum.KeyCode.W and not gme then
        if Sprint == false then return end


        Sprint = false
        Humanoid.WalkSpeed = NormalSpeed
    end
end)```