Loading character from GUI isn't working

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

server scripts wont run in ReplicatedStorage, since its a storage service so nothing there will run
you will have to move the server script to somewhere it will run like ServerScriptService and just reference the remote by going to ReplicatedStorage.RequestSpawn

another thing, player:LoadCharacter() doesnt take any parameters, all it does it respawn the current character

2 Likes

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