Remote events not doing anything

Well I’ve tried everything to fix this and nothing has worked, so I give up on this.

Wait! Show your code from your local script and server script. Where is the local script located at?

Giving up will not help at all. You need to face the problems in order to learn and deal with them the future. If you give up, you dont learn, so please, dont give up (on anything you want to do).

Alright heres the latest code in my localscript which is in the trigger part along with the clickdetector:

local clickDetector = script.Parent.ClickDetector
local ReplicatedStorage = game:GetService("ReplicatedStorage")
clickDetector.MouseClick:Connect(function(player)
	ReplicatedStorage.RemoteEvent:FireServer(player)
end)

the server script is in serverscriptservice and looks like this

local TriggerSwitch = game.Workspace:WaitForChild("TriggerSwitch")
local Lever = game.workspace:WaitForChild("Lever")

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
	workspace.TriggerSwitch.ClickDetector:Destroy()
	workspace.Lever.Transparency = 0
	print("Script did done did")
end)

I’m getting pretty bummed out by this whole thing by now, it feels like I’m getting nowhere with this

Okay. You were supposed to do things the other way around. The Server Script is supposed to fire the remote event to the client. And then the LocalScript should be doing the rest of the work.

Place your server script directly inside the ClickDetector. Then use the following code below:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("RemoteEvent")
local ClickDetector = script.Parent

ClickDetector.MouseClick:Connect(function(player)
	print("Clicked on ClickDetector")
	Event:FireClient(player)
	print("Fired Remote Event")
end)

Now, place your LocalScript in StarterPlayerScripts (which is in StarterPlayer in the explorer menu). Then use the following code below:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local WS = game:GetService("Workspace")

local Event = ReplicatedStorage:WaitForChild("RemoteEvent")
local TriggerSwitch = WS:WaitForChild("TriggerSwitch")
local Lever = WS:WaitForChild("Lever")

Event.OnClientEvent:Connect(function() -- this should be left empty
	print("Received Remote Event Call")
	TriggerSwitch.ClickDetector:Destroy()
	Lever.Transparency = 0
	print("Local Script Successfully done its job!")
end)

Alright after hours of looking like an absolute clown the script finally works, THANK YOU SO MUCH I really couldn’t have done this without you. Well this thread definitely earned me a reputation for being the dumbest developer alive

1 Like

Dont call yourself names. Just because you dont know some things about scripting doesnt mean you dont know anything about scripting. You are not a clown for seeking help on something you are struggling with.

You are at a learning stage right now, and you should not be embarassed by that. Even if people would make fun of you about not knowing specific things, that shouldnt stop you from keep trying and learning. You should not listen to people who are trying to let you down. Otherwise, you would always be staying at the same stage, never moving forward.

Never give up on what you want to achieve.
You are very welcome for solving your issue. I am always happy to help.