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

Torso Gui [closed]

Asked by
ryjaboe 15
10 years ago

How would I put a Gui in the torso of every character in the game?

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
2
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

For future reference, this is not a good question. You can put a GUI Object into the Torso of every character easily by simply parenting it, but it won't display anywhere.

What I assume you mean to ask is, "How do I make a GUI appear on the front of the torso of every player in the game?"

In which case my answer is this:

local gui = Instance.new("SurfaceGui")
gui.Name = "TorsoGui"
gui.CanvasSize = Vector2.new(500, 500)
Instance.new("Frame", gui).Size = UDim2.new(1,0,1,0)

for _, v in ipairs(Game.Players:GetPlayers()) do
    local torso = v.Character:FindFirstChild("Torso")
    local lgui = gui:Clone()
    lgui.Parent = v
    lgui.Adornee = torso
end
0
Thank You ryjaboe 15 — 10y
Ad
Log in to vote
1
Answered by 10 years ago

Should work, Inserts the GUI into the child when a child is added to the Players.

game.Players.ChildAdded:connect(function(child)
if child:FindFirstChild("Character") then
c = GUILOCATIOn
c:Clone.Parent = child.Character.Torso
end
end)