#GUI not updating

1 messages · Page 1 of 1 (latest)

golden saddle
#

as you can see in the screenshot, my code doesnt work. it shows what i put before the code works (loading level). I dont know what im doing wrong. I put it in a local script too and it doesnt work pls help

sullen pulsar
#

You're using StarterGui, you need to access a specific player's PlayerGui

StarterGui is the template.

golden saddle
#

I just changed levelpointtext, levelbar, and level to player gui but it still isnt loading

golden saddle
sullen pulsar
golden saddle
#

it doesnt show any type of error or warning and its located in serverscriptstorage as a normal script

sullen pulsar
golden saddle
#

I dont see anything like that

sullen pulsar
golden saddle
#

its not running. I dont know how that is even happening

sullen pulsar
golden saddle
#

im using serverscriptservice

sullen pulsar
# golden saddle im using serverscriptservice

Okay good then

So it could be possible that, because you're testing, PlayerAdded isn't being connected to before the player joins.

Try taking the function out of PlayerAdded and running it on all players currently in game too

golden saddle
#

so just remove the player added function?

sullen pulsar
# golden saddle so just remove the player added function?

Well I mean you take the function out not just remove it

Players.PlayerAdded:Connect(function()

to

local function name()
end
Players.PlayerAdded:Connect(name)

and use that new function on all players in game before you connect to PlayerAdded

golden saddle
#

now the function wont run because its plr.playergui which doesnt exist in the function. I switched it to starter gui too but it still doesnt work

sullen pulsar
golden saddle
#

Still doesnt work, this is what I have. the function still wont run (sorry if I dont completely understand what you are saying im new to scripting)

sullen pulsar
# golden saddle Still doesnt work, this is what I have. the function still wont run (sorry if I ...

Okay when I said name I didn't mean for you to literally use name, I mean it as an example to show you how to separate a function from the connection

It appears you didn't understand that, as this is a little wild.

take function(plr), the entire function, give it a name of your choice, and put it outside of Player.PlayerAdded:Connect(

Then pass the new name of the function to Player.PlayerAdded:Connect(

above Player.PlayerAdded:Connect, make a for loop that runs through all players in game and calls your new function with the player as the argument

golden saddle
#

now, everything works, but when humanoid.health <= 0 it wont update the baselevelpercent

sullen pulsar
# golden saddle now, everything works, but when humanoid.health <= 0 it wont update the baseleve...

because it's only checking once, when the player is added.

You need to choose a different way to check.

This event may be more helpful: https://create.roblox.com/docs/reference/engine/classes/Humanoid#Died

Also, looking at this again, you need to be using the player's character, not the rig template, as that'd mean every player's death is connected to the same rig

So you probably need to also use CharacterAdded from the player to connect to their humanoid death

A special object that gives models the functionality of a character.

golden saddle
#

I spent a lot of time trying to figure out what would work, and now im stuck. This is my script. it adds 50, but when the next rig spawns in, I dont get anything.

sullen pulsar
golden saddle
#

yes, when the rig dies, from the player attacking, it will update all the gui

sullen pulsar
golden saddle
#

so how would i fix that?