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

How do I make a new instance in a body part (R15)?

Asked by 3 years ago
Edited 3 years ago

I'm making thermal binoculars, and i'm trying to insert a billboard GUI to all the player's heads, but, I have no idea where to put the instance. So for example, if i say:

Instance.new("BillboardGui", game.(where?))

Where do I put the billboardgui so that it's above ALL player's heads. My current code is:

local Tool = script.Parent
local Player = game.Players.LocalPlayer

local trackerui = Instance.new("BillboardGui", Player.Character.Head)
local tracker = Instance.new("ImageLabel")
local thermal = Instance.new("ColorCorrectionEffect", game.Lighting)

Tool.Equipped:Connect(function(mouse)
    --Color correction
    thermal.Brightness = 0.3
    thermal.Contrast = 1
    thermal.TintColor = Color3.fromRGB(255,0,0)
    --Tracker
    tracker.Parent = Player.Character.Head.BillboardGui

end)

Tool.Unequipped:Connect(function(mouse)
    thermal.Brightness = 0
    thermal.Contrast = 0
    thermal.TintColor = Color3.fromRGB(255,255,255)
end)

Answer this question