Replicate Gamemode Variable to Clients

Hey there!

I have a multi player game and my scene has a number generator which is visible for all clients (and the listen server). I need the displayed number to be the same for all clients, so in the Game Mode I made a function to generate a number and set it to a replicated variable and a function to pass it to the Display.

When I just normally call the function to generate a number, it is different for every Client. So I tried to only execute the functions on the server. But now the variable I set does not replicate properly and the clients don’t receive a number at all.
I also tried using RepNotify and passing the variable to the Display in the notify function, but then the displays just showed the default value 0 without replicating the value of the variable.

Can anyone help me with figuring out how to do this?

As it turns out the server and client that I started with my shortcuts outside the editor where not actually connected despite the client having the local id and the server being set as listen server.

The client identified itself as a client, because it was started as one, but since it was unable to connect to a server, it started a server for itself, including a gamemode.

So I actually had two servers running, each playing the correct logic. I don’t exactly know why my first shortcut didn’t work but now it runs as expected.