If statement not working with run on server

Hey

So each time i call a custom event called remo it goes through a if statement returning back as true
but when it hits the if statement is stop working please help

see image below

further update it seems to be the int value not connecting correctly

i have a widget and from clicking a button it +1 the int value but when going through the custom event it doesn’t recognise that there is a value attached? any ideas?

ill show you the code for the widget

Hi, I’m not understanding what your logic should do, but keep in mind that

(-) widgets don’t replicate, so you also can’t meaningfully use “RunOnServer” events on them

(-) variable replication only works from server to client. In your second image the “remo” event executes on the server, so if the client would hit a button to change some variable that the server should know about, you would need to tell the server about it via a “RunOnServer” event somewhere

this is the current code for the widget that sets the int to a value

how would you suggest to do the code for the widget to call it to runonserver?

By going with Player controller, playerstate, gamestate, pawn… or whatever who replicate.

Player controller is usually the way to do this.