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

How to I add face decal to model by clicking?

I’m making a story mode game and I would like to know how to add decals to the model, I only know how to remove them.

MouseButton1Click:Connect((function() workspace.model1.model2.Head.Decal:Destroy()

2 answers

Here you go, I have put all the properties in here so that you have full control of the Decal!

local Workspace = game:GetService("Workspace")
local Button = (script.Parent:IsA("GuiButton") and script.Parent) or script:FindFirstAncestorOfClass("GuiButton")
Button.MouseButton1Click:Connect(function()
	local Decal = Instance.new("Decal")
	Decal.Color3 = Color3.new(1,1,1)
	Decal.Name = ("Decal")
	Decal.Texture = ("rbxassetid://1234567890")
	Decal.Face = ("Front")
	--[[
	Faces:
	("Front")
	("Back")
	("Left")
	("Right")
	("Top")
	("Bottom")
	]]
	for _,Child in pairs(Workspace.model1.model2.Head:GetChildren()) do
		if Child:IsA("Decal") and Child.Face == Decal.Face then
			Child:Destroy()
		end
	end
	Decal.Parent = Workspace.model1.model2.Head
end)
script.Parent.MouseButton1Click:Connect(
    function()
        local decal = Instance.new("Decal", workspace.model1.model2.Head)
        decal.Texture = ("rbxassetid://0000000000") -- decal link here
    end
)

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