local Brick = script.Parent.Parent.Parent local Picture = script.Parent.UserImage local User = script.Parent.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/User.aspx?ID="..Player.userId User.Text = Player.Name end end end script.Parent.Parent.Parent.Touched:connect(onTouch)
""
if (Player ~= nil)then Picture.Image = "http://www.roblox.com/User.aspx?ID="..Player.userId User.Text = Player.Name
"" I can't get this bit to work! Please help me, Thanks!
You need to use the correct format for getting the player's character image. To do this, we'll use:
"http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..Player.Name
So let's insert this into the script:
local Brick = script.Parent.Parent.Parent local Picture = script.Parent.UserImage local User = script.Parent.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=200&y=200&Format=Png&username="..Player.Name User.Text = Player.Name end end end script.Parent.Parent.Parent.Touched:connect(onTouch)
Anyways, it should work now, as I did test it. If not, or if you have any further questions/problems, please leave a comment below. Hope I helped :P