So I want to change the property of all these parts by a RemoteEvent (see picture). But how do I do that? Do I just script them one by one or is there a faster way? Something with GetChildren()? (Tag me when a solution is found)
Picture: http://prntscr.com/k8rl2t
Script that I tried:
game.ReplicatedStorage:WaitForChild("ExteriorLightsEvent").OnServerEvent:Connect(function(Player, ExtLight)
if ExtLight:GetChildren().Transparency == 0 then
ExtLight:GetChildren().Transparency = 1
else
ExtLight:GetChildren().Transparency = 0
end
end)
Script that works (for one part):
game.ReplicatedStorage:WaitForChild("ExteriorLightsEvent").OnServerEvent:Connect(function(Player, ExtLight)
if ExtLight.hlight2.Transparency == 0 then
ExtLight.hlight2.Transparency = 1
else
ExtLight.hlight2.Transparency = 0
end
end)
Thanks in advance.

1 comment
Ah thank you!