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

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

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

✓ Accepted answer

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.

2 comments

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

0

Yes, _G. makes it known across all scripts in the game, that way you can change values while in another script.

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