I have a placement system, and I have it so that when you equip a tool, and click it will clone the structure into workspace and create a billboardgui with a textbutton inside of a screengui inside of startergui. The problem is, I tested it and the TextButton doesn't show up. Here is the script:
game.ReplicatedStorage.RemoteEvents.PlaceStructure.OnServerEvent:Connect(function(Player,Structure,PrimaryCFrame)
if Structure == "Workbench" then
local Clone = game.ReplicatedStorage.Structures[Structure]:Clone()
Clone.Parent = game.Workspace
Clone:SetPrimaryPartCFrame(PrimaryCFrame)
local BillBoardGui = Instance.new("BillboardGui")
local TextButton = Instance.new("TextButton",BillBoardGui)
local ScreenGui = Instance.new("ScreenGui",game.StarterGui)
BillBoardGui.Parent = ScreenGui
BillBoardGui.Adornee = Clone.Center
BillBoardGui.AlwaysOnTop = true
BillBoardGui.MaxDistance = 17
TextButton.BackgroundColor3 = Color3.fromRGB(85,170,255)
TextButton.BorderSizePixel = 0
TextButton.Size = UDim2.new(0,50,0,50)
TextButton.Position = UDim2.new(0,70,0,0)
TextButton.Visible = true
TextButton.MouseLeave:Connect(function()
TextButton.BackgroundColor3 = Color3.fromRGB(85, 170, 255)
end)
TextButton.MouseEnter:Connect(function()
Clone.Top.Hover:Play()
TextButton.BackgroundColor3 = Color3.fromRGB(54, 108, 162)
end)
TextButton.MouseButton1Click:Connect(function()
Clone.Top.Click:Play()
end)
else
local Clone = game.ReplicatedStorage.Structures[Structure]:Clone()
Clone.Parent = game.Workspace
Clone:SetPrimaryPartCFrame(PrimaryCFrame)
end
end)

1 comment
I meant why doesn't it show up*