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
When i try to pass it to the server
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.
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.
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)
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.