Hi, I have a little problem with a part of the UserInputService. For some reason when I press the keycode F to use the ability, nothing happens and no errors in the dev console. The power I have equipped is Radar and for some reason the ability doesn’t work. If anyone knows how to fix this little mistake, I would appreciate it very much.
(Edit): The abilities work when I use the MouseButton1Click, but what doesn’t work is the Keycode, that’s all.
you just need one end after the debounce, adding a second one breaks the elseif:
if input.KeyCode==Enum.KeyCode.F then
if not debounce then
-- code
end --- End for the debounce
elseif input.KeyCode == -- rest of code
if not debounce then
-- code
end
elseif input.KeyCode== --
if not debounce then
-- code
end
end -- end of elseif's
if input.KeyCode==Enum.KeyCode.F then
if player.EquippedVictimPower.Value=="Sprint" then
if not debounce then
debounce=true
sprint()
wait(1)
debounce=false
end
elseif player.EquippedVictimPower.Value=="Radar" then
if not debounce then
debounce=true
radar()
wait(1)
debounce=false
end
elseif player.EquippedVictimPower.Value=="Nightvision" then
if not debounce then
debounce=true
nightvision()
wait(1)
debounce=false
end
end
end
if input.KeyCode == Enum.KeyCode.F then
if player.EquippedVictimPower.Value == "Sprint" then
if not debounce then
debounce=true
sprint()
wait(1)
debounce=false
end
elseif player.EquippedVictimPower.Value == "Radar" then
if not debounce then
debounce=true
radar()
wait(1)
debounce=false
end
elseif player.EquippedVictimPower.Value == "Nightvision" then
if not debounce then
debounce=true
nightvision()
wait(1)
debounce=false
end
end
end