I don’t really have a game and I’m just practicing how to code and I’m trying to use the remote events. I made it work from client to server. However, my server to client side doesn’t work. I don’t get any signals for the client script. It doesn’t give me output errors as well.
Also you shouldn’t be connecting new OnServerEvent and OnClientEvent signals everytime someone respawns, it’s enough to do it once.
ex:
Server Script:
-- whenever anyone contacts the server from their client, this fires
game.ReplicatedStorage.ServerTest.OnServerEvent:Connect(function(player)
print("Server Signal from", player)
-- make the server send data back to the client that contacted the server
game.ReplicatedStorage.ServerTest:FireClient(player, "Hello from the server")
end)
LocalScript
-- contact the server from the client
game.ReplicatedStorage.ServerTest:FireServer()
-- listen to what the server tells to the client
game.ReplicatedStorage.ServerTest.OnClientEvent:Connect(function(text)
print(text)
end)