so like i tried to make these stage lights, if you press like a green button the lights will turn on green, i dont want anything too fancy just something really basic, i need this system done for my game before christmas, let me send some photos for what im trying to make. if anyone could help me make these, or even make them with me on studio id appreciate it 😉
#stage lights, something i tried for months but always failed
95 messages · Page 1 of 1 (latest)
you can use a clickdetector and change the lights color with a color3 value
i dont quite understand this kind of code yet, could you explain a little more (srry im annoying)
are you trying to have multiple light colors?
do you already got the basic lights made in studio
im trying to make basic lights, if i press a pink button a part will turn neon pink, or if i press a green button a part OR multiple parts will turn neon green if that makes sense
im very stuck so i didnt get so far 😭
well assuming just for right now that youve got a light made, what i feel would be the best option is a row of parts with ClickDetectors inside of them, then within a script whenever each is pressed it'll change the Color property of all the lights to the clicked parts color
yea, i got the lights, buttons and scripts but i havent filled any code in yet, could you possibly help me make a code for this?
i have made some partical admitting light things but what im tryna do here is more different
okay well assuming your lights are all exactly the same and put into the same container it'd be something like
local LightsContainer = game.Workspace.Lights -- folder containing light parts
local ButtonsContainer = game.Workspace.Buttons -- assume this is a folder or something containing parts
local function OnClick(ClickedPart:Part)
local AllLights = LightContainer:GetChildren()
for _,v in AllLights do
print("Changed",v.Name,"'s color to",ClickedPart.Name,"'s color")
v.Color = ClickedPart.Color
end
end
for _,v in ButtonsContainer:GetChildren() do
print("adding",v.Name)
local ClickDetector = v:FindFirstChild("ClickDetector") or Instance.new("ClickDetector",v)
ClickDetector.MouseClick:Connect(function()
print(v.Name,"clicked")
OnClick(v)
end)
end
not on pc rn so this probably wont work
shall i group the lights to the button?
no, youd want the lights in something like a folder
same with the buttons
for this im assuming both the lights and the buttons are Parts
can u help me
yea they are parts rn
general outline of workspace would be like
Lights:Folder > All light parts
Buttons:Folder > All buttons
the code should automatically create the clickdetectors
make a post in help then
i usually just browse randomly for stuff
alright thank you, ill try do that code rq
** You are now Level 2! **
the script would probably be inside of ServerScriptService btw
pinged u in one
o
uh lemme fix that
nope it does not work
im gonna use more basic things, for now i just need this pink button to make the sphere neon pink when i press the button if ur still free on helping
i could try and make that 4 u
whats the errors given
please if ur able to im gonna slowly decay making these
i checked console, no errors
i restarted again on a fresh studio now so everything is new and clean
it creates a clickdetector inside the buttons right?
yea i did that
i mean the way that this works is it automatically creates it
let me add some prints and lmk
alright, im gonna try a similar method if someone is free to help me continue this version
i edited the script
delete the clickdetector and script
alr
the script i sent should be inside of serverscriptservice
and remember they have to be in separate folders
a folder names Buttons, and a folder names Lights
have 2 separate folders
so yeah
for each "button" part make sure its in a folder named Buttons
and for each "light" part make sure its in a folder named Lights
like this?
i added prints btw so might wanna use this one
np
if you wanted to add actual light instances itd be similar just change those colors to the part color
this is so cool and yes i will if i needed to in future, thanks so so much!!
** You are now Level 3! **
np
by chance, how could i make the buttons a gui? srry im asking alot
so i dont have like 40 buttons everywhere
RemoteEvents for sending color info to the server
since you want the light colors to be replicated
could you explain a bit more?
mb i was busy, but remote events are basically a way for the client to send information to the server and vice versa
it runs a function through with the given arguments
so if i fired a remote event via
RemoteEvent:FireServer(Color3.fromRGB(255,0,0))
then the server can do
RemoteEvent.OnServerEvent:Connect(function(Player,GivenColor)
print(GivenColor)
end
Player is automatically given
and this would print out the color thing for red i think
np
uh
smth broke
the light is now clickable and not the button and when i click it, it makes the nearby pool like controls go that colour
help 😭
did you switch the folders?
nope
i redid the process to make them in a different game
now they are uh
broken...
its something with the naming then
since if theyre reversed then how one part should function switched over
oh yep found it]