V33S
(lunar)
June 11, 2021, 7:03pm
#1
I made a script that loads an image (a decal) and changes the player’s profile picture in the game, but it doesn’t seem to work I’ve tried both script and local script but nothing seems to work, it just goes blank without an error.
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.e.ImageLabel.ImageLabel.Image = "http://www.roblox.com/asset/?id="..script.Parent.Parent.TextBox.Text
end)
Any help would be appreciated!
B_lial
(B_lial)
June 11, 2021, 7:06pm
#2
you have a stray bracket here and also to make scripting easier and a bit more efficient I recommend using “rbxassetid:// instead” of
V33S
(lunar)
June 11, 2021, 7:11pm
#3
Oh yes sorry forgot to remove the “(” because I was just testing with something else so it can’t be that, do you know any other problems that are possible?
1 Like
TheDCraft
(TheDCraft)
June 11, 2021, 7:12pm
#4
Have you tried "rbxassetid://"..script.Parent.Parent.TextBox.Text
?
And you should probably also convert the text to a number value.
V33S
(lunar)
June 11, 2021, 7:13pm
#6
I could but I want them to be able to have a custom profile picture.
TheDCraft
(TheDCraft)
June 11, 2021, 7:13pm
#7
Oh right, my bad. Yeah forget what I said then
V33S
(lunar)
June 11, 2021, 7:14pm
#8
Tried it just makes the image nothing.
Have you tried converting the text to a number?
V33S
(lunar)
June 11, 2021, 7:14pm
#10
Using tonumber(script.Parent.Parent.TextBox.Text)?
Yes, that could possibly work, it’s worked for me in the past.
V33S
(lunar)
June 11, 2021, 7:16pm
#12
Yes it did work but the image is invisible even though ImageTransparency is false and Visible is true.
V33S
(lunar)
June 11, 2021, 7:48pm
#13
It works with a plain white circle but nothing else do you know why?
If you want a custom profile picture, try this:
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.e.ImageLabel.ImageLabel.Image = game.Players:GetUserThumbnailAsync(player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size352x352)
end)
V33S
(lunar)
June 11, 2021, 7:56pm
#15
Yeah but I want the user to be able to select their own profile picture.
Try this then:
script.Parent.MouseButton1Click:Connect(function()
local playerName = script.Parent.Parent.TextBox.Text
local playerUserId = game.Players:GetUserIdFromNameAsync(playerName)
script.Parent.Parent.Parent.e.ImageLabel.ImageLabel.Image = game.Players:GetUserThumbnailAsync(playerUserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size352x352)
end)
V33S
(lunar)
June 11, 2021, 8:22pm
#17
I meant as in they can have a custom decal and if it’s inappropriate then people can report it.
Do they have to type in the name or the ID?
V33S
(lunar)
June 11, 2021, 8:23pm
#19
They have to type in the decal ID.
B_lial
(B_lial)
June 11, 2021, 8:23pm
#20
IN GENERAL I recommend not having custom decals as people can report your game for inappropriate content if used improperly, I would avoid the feature all together