Remote Event not working

The remote event (Move1IntiateMobile) is located in replicated storage with multiple parent folders [as shown in the image below.]

image

Both scripts are client sided. The main issue is the mobile remote event, I did change the GUI to respond to clicks for testing purposes.

script.Parent.MouseButton1Click:Connect(function ()
	local sg = game:GetService("ReplicatedStorage")
	local mobileFruitMoves = sg:WaitForChild("FruitEvents")
	local baldyMoveEvent = mobileFruitMoves:WaitForChild("BaldyFruitEvents"):WaitForChild("Move1Initiate"):WaitForChild("Move1InitiateMobile")
	print("Test1")
	baldyMoveEvent:FireServer() -- Remote Event is fired
	print("Test2")
end)

Test 1 and test 2 both pass but the second script down here doesn’t seem to react to it, hence the mobile check 1 not printing to the output.

local rs = game:GetService("ReplicatedStorage")
local baldyMove1EventMobile = rs:WaitForChild("FruitEvents"):WaitForChild("BaldyFruitEvents"):WaitForChild("Move1Initiate"):WaitForChild("Move1InitiateMobile")
-- Mobile
baldyMove1EventMobile.OnClientEvent:Connect(function()
	print("Mobile Check 1")
end)

Any help is appreciated, thanks.

Is this the server script?
cause it says

event.OnCleintEvent()

Cause if it is the server it should be,

Event.OnServerEvent()

You’re firing the server but then the second script is baldyMove1EventMobile.OnClientEvent
Either the first script has to be a server script and changed to :FireClients or :FireAllClients, or the second script has to be changed to a server script and say .OnServerEvent instead of .OnClientEvent

The tests pass because the remote event still tries to fire the server, but the second script won’t respond to the command because it’s not a server script.

Got it, will try to change the script to work on the server side, thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.