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

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

Asked by 6 years ago

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

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. hiimgoodpack 2009 — 6y
0
What exactly would the script look like. TheBeaver101 28 — 6y
0
Would it just be script.Disabled = true and script.Disabled = false? Would it be "disabled" instead of "Disabled" TheBeaver101 28 — 6y
0
Why don't you try it out and see which errors? hiimgoodpack 2009 — 6y
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! TheBeaver101 28 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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

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. TheBeaver101 28 — 6y
Ad

Answer this question