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.