So I am working on a Nuclear System and it does not work. It does use a RemoteEvent. When the RemoteEvent activates, it causes a bool value to become True and after a wait(), another one becomes true. This however does not work.
RemoteEvent is located in ReplicatedStorage and is called NukeSystem. Here are the scripts.
ClickDetector:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NukeSystem = ReplicatedStorage:WaitForChild("NukeSystem")
local Notification = ReplicatedStorage:WaitForChild("Notification")
function onClicked()
NukeSystem:FireAllClients("bam")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
ServerScriptService RemoteEvent Handler:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local NukeSystem = ReplicatedStorage:WaitForChild("NukeSystem")
NukeSystem.OnServerEvent:connect(function(bam)
workspace.NukeFacility.Nuke.NukeEnabled.Value = true
wait(79.30)
workspace.NukeFacility.Nuke.Landed.Value = true
end)
Can you please explain why it does not work when I click on the part. Thank You!

17 comments
Any errors?
Nope
try in the clickdetector replacing "bam" with just bam
ok
That has not wirked. bam also beame underlined in blue
show me the new script
local ReplicatedStorage = game:GetService("ReplicatedStorage") local NukeSystem = ReplicatedStorage:WaitForChild("NukeSystem") local Notification = ReplicatedStorage:WaitForChild("Notification") function onClicked() NukeSystem:FireAllClients(bam) Notification:FireAllClients("NUKE", "A Nuke was launched! Avoid Downtown!") end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Are you using a local script for the click detector? It seems like you are using a local script to fire a event for all clients from the client it self. iirc, FireAllClients is for server script only.
Both are a Script. Not Local scripts. Should I chagnge them where should the Serverscriptservice script go?
Ahhhh... If im right, you are using a server script to detect a server event. Change the service script in server script service into a local script.
Should I change where the location of the new local scrpt is?
Yes, put it into the starter player scripts
Does not work. Error: OnServerEvent can only be used on the server. Located in Line4
Oh my bad, change that to OnClientEvent instead. Since you are already using a server script to fire all clients, you use that to let the client receive the event
It is Semi Broken. Its Value is enabled to my client but not to the server. I need it to be Enabled on both. How would I do this?
Do you want to have a local script and a server script or both server scripts? Since this will change the Remote event being used.
I would love to have both honestly. Just a bit confusing on how.