I am making an audio visualiser that works with a spotlight, but for some reason, when I try it on a server, it doesn't work, but when I run it on Studio it is fine, here is the script:
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.Toggle.Value == false then
script.Parent.Parent.Toggle.Value = true
while script.Parent.Parent.Toggle.Value == true do
wait(0.5)
script.Parent.Parent.Parent.Parent.VisualiserSpotlight.SpotLight.Brightness = script.Parent.Parent.Parent.Parent.SoundBoard.SurfaceGui.EnterA.Sound.PlaybackLoudness/100+0.5
print(script.Parent.Parent.Parent.Parent.SoundBoard.SurfaceGui.EnterA.Sound.PlaybackLoudness/100+0.5)
if script.Parent.Parent.Toggle.Value == false then
break
end
end
end
end)

4 comments
Are there any errors? Also, you should use variables more. It would help clean up your code.
you shouldnt have 4 Parents in a row in your script
Local script?
I've got the same problem. I'm quite experienced in Roblox Lua aswell, I'm quite sure it doesn't work online.