#GUI not updating on value set

1 messages · Page 1 of 1 (latest)

hexed night
#

This script only doesn't work on the first time I change the coin amount in my script, which sets the coin amount to 5 for all players. It only updates once you get coins organically during gameplay. It's placed after the event call so there's no way it would've not caught it. Any idea why this is?
I previously tried using .Changed, but it didn't work either.

celest loom
#

I would say something but as a russian person i can say i will get cooked if i get it wrong

crimson estuary
#

Why are you doing n.player.PlayerGui if you’re passing a player list?

rich knollBOT
#

studio** You are now Level 9! **studio

crimson estuary
#

Assuming you’re passing a list of player objects then n.PlayerGui should work?

#

@hexed night

crimson estuary
#

I’m acc learning russian so

crimson estuary
hexed night
#

i could probably do that?

crimson estuary
#

you could definitely do that

#

no need to pass playerlist unless you’re doing some unnecessary black magic shit

#

where playerlist does not contain actual players

hexed night
#

it does though.

#

and this did not fix my problem

crimson estuary
#

Also why are you using .OnClientEvent and trying to modify other clients guis?

#

You can only do that on the server

hexed night
#

oh i am doing that

#

true, thank you!

#

not really my issue though

crimson estuary
hexed night
#

i did and it didnt fix it

crimson estuary
#

You completely refactored your code to be on the server side instead of the client side in like two minutes? Can you send your updated scripts?

#

Also any errors?

hexed night
#

i didnt do that though

#

i just changed statFrame to refer to the local player's gui instead of the selected player

#

since its displaying all the players' stats on the screen

#

thats why im running through all of them

crimson estuary
#

Right I am pretty sure I found the issue

#

So you’re firing the StatUpdateEvent, the client picks up the event, and then it connects a PropertyChangedSignal meaning the updated value is missed

#

Also you shouldn’t really connect events like that inside other events generally since you can cause memory leaks and shit iirc

#

You can skip the GetPropertyChanged signals entirely and just set the values outright from their current leaderstats values

hexed night
#

yeah but how would i update them

#

wait i get what you mean

#

that worked

crimson estuary
#

👍