Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my Player Image Billboard Gui not working?

I'm trying to make a billboard gui so when you walk up to it it shows your player image but it wont work here is my code local Brick = script.Parent.Parent.Parent

local Picture = script.Parent.UserImage

local User = script.Parent.Usename

function onTouch(Object)

local Character = Object.Parent.findFirstChild("Humanoid")

if(Character ~= nil)then
	local player = game.Players:GetPlayerFromCharacter(Object.Parent)
	
	if(Player ~= nil)then
		
		Player.Image = "http" .. Player.Name
		User.Text = Player.Name
		
	end
end

end

script.Parent.Touched:connect(OnTouch)

1 answer

Try this, haven't tested it so not sure if it works 100% like it should.

local Brick = script.Parent
local Picture = script.Parent.BillboardGui:WaitForChild('UserImage')
local User = script.Parent.BillboardGui:WaitForChild('UserName')
function onTouch(Object)
	local Character = Object.Parent:FindFirstChild("Humanoid")
	if(Character ~= nil)then
	    local player = game.Players:GetPlayerFromCharacter(Object.Parent)
	    if(player ~= nil)then 
	        Picture.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=" .. player.Name
	        User.Text = player.Name
	    end

	end

end
script.Parent.Touched:connect(onTouch)

This discussion is preserved as it was. New answers, comments, and votes are closed.