If a brick is touch by a player the textlabel of billboard gui will print the name of player. The BillBoardGui is inside the "Head" both head and Script is inside the "Model" Here's my model format +Model ++Script Head +BillBoardGui ++TextLabel I don't know whats wrong to my script..
script.Parent.Touched:connect(function(hit) s = plr:findFirstChild("Name") parent.BillBoard.TextLabel .Text = "You have won!"..s script.Parent.Touched:connect(onTouch)
local parent = script.Parent parent.Touched:connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") local hitterName if humanoid ~= nil then hitterName = humanoid.Parent.Name parent.Billboard.TextLabel.Text = "You have won, "..hitterName.."!" end end)
What the script does is: checks if the object that touched the part has a Humanoid on it's model. If it does, it most likely is a player, so we get the model name.