#GUI not updating
1 messages · Page 1 of 1 (latest)
You're using StarterGui, you need to access a specific player's PlayerGui
StarterGui is the template.
I just changed levelpointtext, levelbar, and level to player gui but it still isnt loading
what's the script now
errors? warnings? What kind of script is this and where
it doesnt show any type of error or warning and its located in serverscriptstorage as a normal script
If you wait a bit you don't see anything about potential for infinite waiting or anything like that?
I dont see anything like that
Is that function even running? If you put a print at the start of the function, do you see it
its not running. I dont know how that is even happening
Wait, are you using ServerScriptService or ServerStorage?
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
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
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
Well when you took the function out did you also take out the player parameter? Gotta still have that. I was just trying to demonstrate what I meant by "taking out the function"
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)
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
now, everything works, but when humanoid.health <= 0 it wont update the baselevelpercent
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
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.
because it's only connected to that one rig once.
Is this connecting to the rig's death, the one players might attack?
yes, when the rig dies, from the player attacking, it will update all the gui
Okay, so that's only connected to that one rig, and it only connects once, and the rig's death would affect everyone who joined before the rig died
so how would i fix that?