Remote event firing but at the same time not (Remote Event problem)

So nothing to explain here,

When I try to fire a remote event from the client it outputs “Event fired” which is meant to be like that on the client, but when I try to get the print from the serverscript it doesn’t print the “HUH???” on output, the event is inside a gui.

FireServer from local script
afbeelding

afbeelding

When i try to pass it to the server
afbeelding

It doesn’t even print it, I tried changing up the stuff by putting the event in replicated storage and the serverscript in serverscriptservice, only it did not work again, can anybody adress what the problem here is? because I’m starting to get a little frustrated here with this.

RemoteEvent needs to be in ReplicatedStorage.
And Server Script needs to be in ServerScriptService.

Read the whole topic please, I already explained what i did.

I see but from what I see you are getting the event in the client somehow can you explain it?

No, I fire the event from the client, but when it goes to the serverscript it does not print what it’s meant to print

Yea but you need to have one Event located in ReplicatedStorage.

And fire the event from ReplicatedStorage from Client.

I already tried putting the remote event in replicated storage and putting the serverscript in serverscriptservice, it did not work and i double checked it.

I’m not sure, but I think you need to define the player argument in OnServerEvent

1 Like

Nope, still does not work, I can’t figure out the problem

Can you show us a screenshot of the explorer?

1 Like

Try this

Put RemoteEvent with name RemoteEvent in ReplicatedStorage.

Client Code:

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

ButtonToClick.MouseButton1Click:Connect(function() 
Event:FireServer("Close!") 
end) 

Server Side Code:

local Event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent") 

Event.OnServerEvent:Connect(function(player,msg) 
print(player.Name.. " sent to server "..tostring(msg)) 
end) 
4 Likes

It should work, btw missing " after "ReplicatedStorage

1 Like

Oh yeah sorry I wrote it quickly.

2 Likes

“script.Parent” in the server script is ServerScriptService, not ReplicatedStorage. So I’m pretty sure you should get an error/warning here.

1 Like

Can we have more context? Location of scripts? Errors?

1 Like

No i did change up the code later on, i just put it back on normal again.

Can you try what I wrote for you?

@caviarbro’s code should make it work properly.

1 Like

Yes this worked, tysm, I been struggling with this for the past 40 minutes.

1 Like

Also, slightly unrelated. But for the sake of future debugging in your development, maybe consider naming your GUI elements something meaningful. It helps everyone involved. Have a good day.

1 Like