I don't know how to put this into words properly but i want it so when i press x the array gets added by 1 for example...
id = { "apple", "sad" , 202049 }
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key)
if string.lower(key) == "x" then
print(id[+1])
end
end)
console when i press x
apple
when i press it again
sad
I appreciate your help!

3 comments
Thanks so much!
I'd also recommend looking into UserInputService or ContextAction service, as KeyDown and KeyUp are deprecated.
It was just an example my actual script uses gui buttons, But thanks for the tip!