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

How do I change an assetID in a script?

	game.Players.PlayerAdded:connect(function(player) 
	player.CharacterAdded:connect(function(character)
	wait(1)
	for i, v in pairs(character:GetChildren()) do
            if v:IsA("Decal") then
			local asset = v.Head.Decal.Texture
			
			local assetId = tonumber(asset:match("%d+"))
			end
		end
	end)
end)

This is all I have of the script right now, what it's going to do is take the player's face and change it to rbxassetid://290788806, or the old :> face on Roblox.

I don't know how to change an ID through a script, and if any of you could help me that would be very nice and very much appreciated.

1 answer

✓ Accepted answer

Simple fix,

ROBLOX Assets are pointed to with the help of "rbxassetid://000000" where the 000000 is the asset id.

game.Players.PlayerAdded:connect(function(player) 
    player.CharacterAdded:connect(function(character)
	    wait(1)
	    for i, v in pairs(character:GetChildren()) do
	            if v:IsA("Decal") then
	            local asset = v.Head.Decal.Texture
	            local assetId = "rbxassetid://"..asset:match("%d+")
	            end
	        end
    end)
end)

1 comment

0

Thank you!

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