Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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 .....

0
if you want more modes you can use more numbers shanelaw12 64 — 4y
0
If i want to switch it to Q and E do i replace 0 and 1 to Q and E? Darkspindash1 -13 — 4y
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. shanelaw12 64 — 4y
0
Alright Darkspindash1 -13 — 4y
View all comments (5 more)
0
Where do i put the script? Darkspindash1 -13 — 4y
0
depending where you want to put it shanelaw12 64 — 4y
0
Examples? Darkspindash1 -13 — 4y
0
localscript where you want the inputs to be in shanelaw12 64 — 4y
0
Thanks Darkspindash1 -13 — 4y
Ad

Answer this question