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

Question regarding billboard gui's ?

Asked by 10 years ago

I am trying to add billboard gui's to player's heads. I copied the script out of another game I had and for some reason it no longer works, in the original game and in play solo the scripts work fine (they are both in server scripts) I added prints all through and they all print, the player/character are both defined correctly, what could be wrong?

function bg2(player12,cil)
    print("received")
    print(player12.Name)
    local character = player12.Character
    if cil == "cop" and character then
        print("try")
        bg = Instance.new("BillboardGui")
        bg.Parent = character.Head
        bg.Adornee = character.Head
        bg.Size = UDim2.new(1, 0, 1, 0)
        bg.StudsOffset = Vector3.new(0, 2, 0)
        frame = Instance.new("Frame")
        frame.Parent = bg
        frame.Size = UDim2.new(1, 0, 1, 0)
        frame.BackgroundTransparency = 1
        frame.BackgroundColor3 = Color3.new(1, 1, 1)
        text = Instance.new("TextLabel")
        print("try2")
        text.BackgroundTransparency = 1
        text.BorderSizePixel = 0
        text.Font = "ArialBold"
        text.TextStrokeTransparency = 0
        text.FontSize = "Size18"
        text.Parent = frame
        print("try3")
        text.Position = UDim2.new(0.25, 0, 0.25, 0)
        text.Size = UDim2.new(0.5, 0, 0.5, 0)
        text.Text = "Cop"
        text.TextColor3 = Color3.new(0,0,255)
    elseif cil == "jailer" and character then
        bg = Instance.new("BillboardGui")
        bg.Parent = character.Head
        bg.Adornee = character.Head
        bg.Size = UDim2.new(1, 0, 1, 0)
        bg.StudsOffset = Vector3.new(0, 2, 0)        
        frame = Instance.new("Frame")
        frame.Parent = bg
        frame.Size = UDim2.new(1, 0, 1, 0)
        frame.BackgroundTransparency = 1
        frame.BackgroundColor3 = Color3.new(1, 1, 1)         
        text = Instance.new("TextLabel")
        text.BackgroundTransparency = 1
        text.BorderSizePixel = 0
        text.Font = "ArialBold"
        text.TextStrokeTransparency = 0
        text.FontSize = "Size18"
        text.Parent = frame
        text.Position = UDim2.new(0.25, 0, 0.25, 0)
        text.Size = UDim2.new(0.5, 0, 0.5, 0)
        text.Text = "Jailer"
        text.TextColor3 = Color3.new(255,0,0)
    end 
end
0
output = received, cracky4, try, try2, try3 crackabottle123 110 — 10y

Answer this question