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

The connection between a Workspace player and their Players data?

Asked by
emite1000 335 Moderation Voter
10 years ago

The title says it all. I need to find the connection, probably a method between a Workspace player and their game.Players data.

Example: I have a Gui that I want cloned from a character in game.Workspace.Player32, and it to go to their PlayerGui. How do I make it go there without knowing their Player number?

0
I answered on my last anser!!! HexC3D 830 — 10y
0
Typo^ HexC3D 830 — 10y
1
:GetPlayerFromCharacter(). Plus the name would be the same. GoldenPhysics 474 — 10y
0
@HexCD, first of all I didn't know you edited your answer. But anyway, your answer to my last question does not answer this one at all. @GoldenPhysics, perfect!Just the answer i was looking for! If you want to put it as an answer to this question I'll +1 it and accept it. emite1000 335 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago
local player = game.Players:GetPlayerFromCharacter(Workspace.Player32)

if player then
player.PlayerGui.ScreenGui.Frame.Visible = true
end

inverse

local character = game.Players.Player32.Character

if player then
character.Torso.Transparency = 1
end

I hope I help.

Ad
Log in to vote
0
Answered by
emite1000 335 Moderation Voter
10 years ago

:GetPlayerFromCharacter()

That's all I needed. Props to GoldenPhysics for the answer.

Answer this question