I'm trying to create a game where if a player presses F, an orb appears over their shoulder, and if they press it again, a second orb appears in a second place, the code is essentially this (this is shortened down):
player = game.Players.LocalPlayer mana = 2 numberoforb = 0
function onKeyPress(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.F and mana > 0 and numberoforb == 0 then
[It makes the orb] mana = mana-1 numberoforb = numberoforb + 1
end
elseif input.KeyCode == Enum.KeyCode.F and bang >0 and numberofbang == 1 then [it makes the second orb] end end end
for some reason, this only lets me spawn 1 orb, if you press F again, it does nothing. What am I doing wrong?
The "numberofbang" variable are not defined, I think you wanted to put numberoforb