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

Is there an efficient way of disabling script/local script through another script/local script?

Asked by
AyeJude 41
6 years ago

Ok so basically, I have scripted a fist combat system where when you press certain keys an animations play, but the thing is when I have weapons equipped, the sword animation gets overridden by the fist combat system I had made. If you could kindly just give me some information to prevent this from happening, that would be great.

Any help would be appreciated.

1 answer

Log in to vote
0
Answered by 6 years ago

You could make a global variable to communicate across scripts. Add to your keybind "_G.AnimPlaying = true" and in the script inside your sword that plays animations add "if _G.AnimPlaying then return end. Hope I helped.

0
so ``_G`` makes it a global variable and accessible to all scripts? I didn't ask the question you are responding to, I'm just curious since I've seen it but didn't know what it was Audiimo 105 — 6y
0
Yes, _G. makes it known across all scripts in the game, that way you can change values while in another script. cmgtotalyawesome 1418 — 6y
Ad

Answer this question