Server not receiving remote event fired from playergui

1. What do you want to achieve? Keep it simple and clear!

I’m trying to fire an event from a playergui button and have the event be received by a script in the player’s tool.

2. What is the issue? Include screenshots / videos if possible!

I’ve done debugging to see if the section that fires the event is working or not, everything seems to work but the firing of the event

3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

And I’ve tried sending the event to the server to relay back to the tool, but the server isn’t receiving the event neither…

can you show some snippets of your code. Especially Where you referance the remote event and the code block in which you fire / recieve the event.

I need to see the code so that I can look at it in details and try to figure out to full potential.

Very sorry for the late reply, here’s sections of my scripts for the event

Local script of playergui button:

local event = game.replicatedstorage.selectevent
script.parent.MouseButton1Click:Connect(function()
    if script.parent.BackgroundColor3 == Color3.fromRGB(122,0,0) then
        event:FireServer()
    end
end

Serverscriptservice:

game.ReplicatedStorage:WaitForChild("selectevent").OnServerEvent:Connect(function(player)
    game.ReplicatedStorage.selectevent:FireClient(player)
    print(game.ReplicatedStorage.selectevent) --debugging attempt, but it doesn't print
end

Local script in tool:

local SelectEvent = game.ReplicatedStorage.selectevent

SelectEvent.OnClientEvent:Connect(function(player)
    print("Recieved")
end

It seems you are trying to communicate from one local script to another, so instead of involving the server, I would use a BindableEvent. Also, to resolve the event not being received, have you tried temporarily remomoving the BackgroundColor3 == Color3.fromRGB(122,0,0) if statement for debugging?

1 Like

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