Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i access the player gui using the players character?

Asked by
Jumbuu 110
8 years ago

this is not a request, i just want to know what is the event or function

0
you don't need getPlayerFrom characetr there. Just use the player param from PlayerAdded theCJarmy7 1293 — 8y
0
iFireLazer is right. theCJarmy7 1293 — 8y

2 answers

Log in to vote
1
Answered by
theCJarmy7 1293 Moderation Voter
8 years ago

game.Players:GetPlayerFromCharacter(char) is what you need!

char = Something:FindFirstSomething("whateva")
player = game.Players:GetPlayerFromCharacter(char)
playerGui = player.PlayerGui

Leave a comment if you need anything clarified.

0
https://gyazo.com/184beef3032611c0943b4fe3760444f2 this is my script, when i do this it says that get player from character is not a valid member of model Jumbuu 110 — 8y
Ad
Log in to vote
1
Answered by 8 years ago

When you use the Player Added function, the argument you pass it is the player. Which basically means that you can detect the player, then just use the argument you passed to get the player. And since the PlayerGui is in the player, you can do local plrGUI = plr.PlayerGui (assuming you passed plr to the PlayerAdded function). So, (looking at the link you at on theCJarmy7's answer) the whole character added thing, isn't even needed. However, if you do need to get the players character, you can just do local character = plr.Character (once again, assuming you passes plr to the PlayerAdded function). Feel free to ask any questions, because that may be a little confusing.

0
yes i can do all this but when i start server, it says experience gui is not a member of player gui, when i use waitforchild experience gui, that doesnt work too Jumbuu 110 — 8y

Answer this question