Trying to make a script where it parents billboard gui when touched

Hello, I am making the following script of where a specific team touches a specific brick triggering a function on them to clone a billboard gui on their head. So far it has not worked and is not displaying any errors. Ideas?

This is a server script by the way.

local TERMINATE = game.StarterGui.BillboardGui

script.Parent.Parent.CDTERMINATE.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	if humanoid then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if plr.Team == "Class-D" then
			TERMINATE.Parent = plr.Head
		end
	end
end)

Try putting this BillboardGui in serverstorage

image
Its still not showing it ontop of my head

local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")

local TERMINATE = SeverStorage:WaitForChild("BillboardGui")

script.Parent.Parent.CDTERMINATE.Touched:Connect(function(hit)
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    
    if not humanoid then return end
    
    local player = Players:GetPlayerFromCharacter(hit.Parent)
    
    if player.Team.Name == "Class-D" then
        TERMINATE:Clone().Parent = hit.Parent.Head
    end
end)
1 Like