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

how do you add more then one on a script?

Asked by 10 years ago

how do you add more then one on a script my problem is that i have more then one lamp but this is only going for the parent on one

script.Parent.Parent.Lamp.Light.SpotLight i have like 13 more lamps that i need activated i need many of them

3 answers

Log in to vote
1
Answered by
Ortron 27
10 years ago

I might be wrong but you could add a BoolValue (A true or false value) in workspace for all of the scripts to use.

Somewhere in the script will be this line: if game.Workspace.MyBool=true then --"MyBool" is the name of the book value script.Parent.Enabled=true -- Assuming the script is in the point/spot light else if game.Workspace.MyBool=false then script.Parent.Enabled-=False

For the above to work you could use a while true do loop or .Changed.

Ad
Log in to vote
0
Answered by
Irvene 5
10 years ago

Right click, copy, paste inside lamp.

Log in to vote
0
Answered by 10 years ago

Make sure you model the lamps otherwise you would run into problems. Each one should have a lamp and a button.

Answer this question