How do i make a person fly when space is held down and W key is pressed twice

I have tried out this script but it dosent work
‘’’
local flying = false
uis.InputBegan:Connect(function(key,chat)
if chat then return end
if Keycode == Enum.Keycode.SPACE +[2x tap] W then
if flying then
flying = false
else
flying = true
end
end
end)
‘’’

1 Like

Is this the whole script? You need to do more to make the character fly than just tell it to fly. Also you make the quote blocks with the backtick that is above your tab key and left one of the 1 key. Not the apostrophe that is left of the enter key.

1 Like

Thanks for the Suggestion. Should i send the Entire script?

1 Like

Yes. It’s always easier when we have all of the relevant code so we’re able to help you as much as possible without inferring anything.

1 Like

I did’nt send it because i felt it is useless as all i need is the keycode

I do need this type of key featuring with combo’s neither so it may aswell be neat

Give me a minute i shall send it

And he never sent it, the end.

1 Like

just a sec I am just finishing that code

Can you please correct the fourth line if that code such that when I press space plus W twice the flying variable changes accordingly… I can handle the remaining part of the flying