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

How do I make this script that enables or disables the referred script work?

I'm looking for a way to make it so when this line of code runs, the script that it is referring to would get disabled, or enabled. This is what I have so far.

script.Enabled=true
--or
sciript.Disabled=true

Please tell me what I am doing wrong, thank you!.

5 comments

0

Thats just inconvenient to change 2 properties. It is like having Collide and CanCollide. If you look in your properties, you'll find the right one.

0

What exactly would the script look like.

0

Would it just be script.Disabled = true and script.Disabled = false? Would it be "disabled" instead of "Disabled"

0

Why don't you try it out and see which errors?

0

Please, just tell me. I've been working for MONTHS on this stupid project and I just need this one line of code, PLEASE!

1 answer

Confusing, you want the script to be the reverse of what it is right now? just do

script.Disabled = not script.Disabled

not associated with a boolean (true / false) will return the reverse of it not true = false not false = true

1 comment

0

Didn't work, let me give more context. Basically when a brick is hit, I want it to activate the script in another brick named "FD1". Basically I was thinking "script.Parent.Parent.FD1.Disabled = false" while in the properties the script in "FD1" is disabled.

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