EVERYTHING IN BOLD FROM HERE ON OUT IS WHERE EVERY SCRIPT IS LOCATED. ABOVE IT IS WHAT TYPE OF SCRIPT IT IS. Alright so, this is suppose to trigger the event and change the pointlights color that is inside parts that is also inside a model. The first script is the one i'm having issues with, its a local script trying to fire server and it won't allow the FireClient or FireAllClients to happen. This script is a local script. game.Workspace.ArenaLights.White
Power = script.Parent.Power --Made By MillerrIAm --Helpers Liliardio & WeArefSociety -------------------------------------------------------------------- --Start Script function change() game.ReplicatedStorage.LightingEvents.ArenaLightsEvent:FireServer("White") end script.Disabled = true
This is what is suppose to to call for the script above to work. #2 This is a script, not local or module. game.Workspace.TronsFolder[NewTron].Main[Script|ArenaLights]
Power = script.Parent.Power ArenaLights = game.Workspace.ArenaLights --Made By MillerrIAm --Helpers Liliardio & WeArefSociety -------------------------------------------------------------------- --Start Script Power.Changed:Connect(function(Value) if Value then while Power.Value do ArenaLights.White.Disabled = false wait(0.1) ArenaLights.Blackout.Disabled = false wait(0.1) --Just duplicate this and the line above. end end end)
This script works perfectly fine but I figured it could help.#3 This is a script, not a local script or a module script. game.ServerScriptStorage[Scripts|LightingEvents].[Script|ArenaLighting]
Lighting = game:GetService('Lighting') -- This line isn't needed though. ReplicatedStorage = game.ReplicatedStorage parts = game.Workspace.ArenaLights:GetChildren() -------------------------------- game.ReplicatedStorage.LightingEvents.ArenaLightsEvent.OnServerEvent:Connect(function(player,arenalight) local children = game.Workspace.ArenaLights:GetChildren() if arenalight == "BrightWhite" then --White Lighting for i, v in pairs(children) do if v:FindFirstChild("PointLight") ~= nil then v.PointLight.Color = Color3.fromRGB(255, 255, 255) end end wait(0.01) elseif arenalight == "White" then for i, v in pairs(children) do if v:FindFirstChild("PointLight") ~= nil then v.PointLight.Color = Color3.fromRGB(255, 255, 255) end end wait(0.01) elseif arenalight == "Blackout" then for i, v in pairs(children) do if v:FindFirstChild("PointLight") ~= nil then v.PointLight.Color = Color3.fromRGB(0, 0, 0) end end wait(0.01) end end)
Thank you in advance for any help, comments & answers!
The first issue I'm seeing is with your first script being a LocalScript in workspace. The only way a local script will run is if it is a descendant of the following:
-A Player’s Backpack , such as a child of a Tool
-A Player’s Player/Character|character model
-A Player’s PlayerGui
-A Player’s PlayerScripts .
-The ReplicatedFirst service
Now a second issue I'm seeing is you're using Remote Events when their is no communication between the Client and the Server. The solution to this is to use something called "Bindable Events", which excel at server-side communication. Here is a wiki article showing you how to use them:
https://developer.roblox.com/en-us/api-reference/event/BindableEvent/Event
In conclusion, change your local script to a server script, and switch your events to Bindable Events.
Try deleting the function in the first script, that should do the trick.
I believe the issue might be that your Change() Function is never being fired. You have set the Function but not called it. Try doing this:
Power = script.Parent.Power --Made By MillerrIAm --Helpers Liliardio & WeArefSociety -------------------------------------------------------------------- --Start Script function change() game.ReplicatedStorage.LightingEvents.ArenaLightsEvent:FireServer("White") end change() script.Disabled = true
or
Power = script.Parent.Power --Made By MillerrIAm --Helpers Liliardio & WeArefSociety -------------------------------------------------------------------- --Start Script game.ReplicatedStorage.LightingEvents.ArenaLightsEvent:FireServer("White") script.Disabled = true
Other then that, I can't find anything else wrong. Hope this fixes the problem. Best of Luck!