I’m trying to make a gui that allows players to spawn at the press of a button as opposed to when joining.
The client script seems to work fine, printing the name of the remote event everytime it is pressed.
However, the server script I’ve made has problems and does not seem to respond to the remote event (it doesn’t even print).
Here is the client script, which is located in a button in a screengui in playergui
local button = script.Parent
button.Activated:Connect(function()
print(button.Parent.Parent)
game.ReplicatedStorage.RequestSpawn:FireServer()
end)
here is the server script, which is located in the remotefunction in replicatedstorage
local event = script.Parent
event.OnServerEvent:Connect(function(player)
player:LoadCharacter(game.ServerStorage.StarterCharacter)
end)
I’ve tried searching the devforum and tutorials for help, but nobody seems to be having the same specific problem.
Is there an issue with the script or should I move the serverscript out of replicatedstorage