Remote event isn't working right

So I have been working on a main menu for a gun related game. It’s great, until you click the button that says “Menu” to load the menu. For some reason, the remote event isn’t firing. I made a local script in starter gui in a text button that fires a remote event that clears your backpack and startergear, but it’s not working

Local script:

local plr = game.Players.LocalPlayer
local event = game.ReplicatedStorage.RefreshEvent
print("Client variables have been set!")

script.Parent.MouseButton1Click:Connect(function()
	event:FireServer(plr)
	print("Client event has begun")
	script.Parent.Parent.Parent.MainFrame.Visible = true
	script.Parent.Parent.Visible = false
	print("Stuff has been changed!")
end)

Server Script:

local event = game.ReplicatedStorage.RefreshEvent
print("Server variables have been set!")

event.OnServerEvent:Connect(function(plr)
	print("Event activated!")
	plr.StarterGear:ClearAllChildren()
	plr.Backpack:ClearAllChilden()
	print("Items refreshed!")
end

The server script is in serverscript storage.

I don’t know why it isn’t working, any help would be appreciated.

change this to

event:FireServer()

other then that the server script should be in serverscriptservice
I don’t see any other problems besides that one

1 Like

I meant service thank you, but how do I get the player on the server?

wdym, you just put the “plr” variable in the OnServerEvent

you don’t need to put plr in the :FireServer()

Event:FireServer(Data)

Event.OnServerEvent:Connect(function(Player, Data)

end)
Event:FireClient(Player, Data)

Event.OnClientEvent:Connect(function(Data)

end)
1 Like

The first parameter of a remote event once it’s been fired, is the player that fired it.

event.OnServerEvent:Connect(function(plr) -- the first parameter is already given.
end)
1 Like

Still doesn’t work for some reason, here are some images:

image
^This is where the local script is.^

image
^This is where the server script is.^

image
^Half of the menu gui.^

image
image
^Other half of the menu gui.^

I made 2 horrible typos sorry,

awesome that you got it fixed, honestly I don’t know how I didn’t notice that

1 Like

Because of the guns in the game. the output was clogged up super heavily, so I couldn’t see the error there, big mistake on my part.