Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i make a combat system where i can switch modes?

I'm making a combat system where if i press a Certain key it'll move to a different mode and give it different attacks. A bit like the star glitcher. How do i do this?

1 answer

✓ Accepted answer

what i would do is use 0 and 1, as the "modes" so the concept basically is :

local mode = 0 

--lets say the button to switch modes is Q
if Q is pressed and mode == 0 then 
mode = 1
end
if Q is pressed and mode == 1 then
mode = 0
end

if ..........keypressed and mode == 0 then
do ....

if ........ keypressed and mode == 1 then
do .....

9 comments

0

if you want more modes you can use more numbers

0

If i want to switch it to Q and E do i replace 0 and 1 to Q and E?

0

do you mean the modes? yes you could do that. but if you want to make more than 2 modes i suggest you use numbers as it is easier.

0

Alright

0

Where do i put the script?

0

depending where you want to put it

0

Examples?

0

localscript where you want the inputs to be in

0

Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.