I think I made it pretty clear in the title. All I want to achieve is making my script fire a remote that makes a local script do something. Is there any function for that or anything that could help me do this.
I should mention that my script is firing after a click detector is clicked.
You need one script, one localscript and a remote event object. I would put the remote event in replicated storage so both scripts can see it. I would put the script in serverscriptservice and the localscript in the playerscripts.
Localscript;
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage.RemoteEvent
event.OnClientEvent:Connect(function(vlaue)
print(value)
end)
Server script;
local ClickDetector = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage.RemoteEvent
ClickDetector.MouseClick:Connect(function(plr)
event:FireClient(plr,"hi")
end)
Alternatively if you want every client to know about the event you can use :FireAllClients()