I have a script that when you touch a block named something, it puts the decal of the touched block on your face of the player.
The script goes in the serverscriptstorage but doesn't seem to work.
I got help the other day on getting where I am now and I appreciate those efforts, but if anyone could help getting this script operational that would be great!
Any feedback is great and thank you in advance!
Maybe I should switch the order of the functions?
function getDecal()
local decals = game.Workspace:GetDescendants()
for i,v in pairs (decals) do
if v:IsA("Decal") then -- check if the descendant is a decal
if v.Parent.Name == "FaceChanger" then -- the decal's parent's name
v.Touched:Connect(function(hit)
-- clones the texture to the hit.Parent's face, make sure to check if their humanoid is present first
end)
end
end
end
end
function onTouch(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
local head = hit.Parent:FindFirstChild("Head")
if head ~= nil then
local face = head:FindFirstChild("face")
if face.Texture ~= getDecal().Texture then
face.Texture = getDecal().Texture
end
end
end
end
script.Parent.Touched:Connect(onTouch)

1 comment
Update: switching order did not resolve issue