BRANDON_GAMERZ

Roblox Face changer script

Feb 19th, 2021
1,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function getDecal()
  2. decals = {}
  3. for i,child in pairs(script.Parent:getChildren()) do
  4. if child.className == "Decal" then
  5. table.insert(decals, child)
  6. end
  7. end
  8. if #decals ~= 0 then
  9. return decals[math.random(1, #decals)]
  10. end
  11. return nil
  12. end
  13.  
  14. function onTouch(hit)
  15. if hit.Parent:findFirstChild("Humanoid") ~= nil then
  16. local head = hit.Parent:findFirstChild("Head")
  17. if head ~= nil then
  18. local face = head:findFirstChild("face")
  19. if face.Texture ~= getDecal().Texture then
  20. face.Texture = getDecal().Texture
  21. end
  22. end
  23. end
  24. end
  25.  
  26. script.Parent.Touched:connect(onTouch)
  27.  
  28. Click here and watch to make a face changer in roblox : https://youtu.be/sAV76u_mbfY
Add Comment
Please, Sign In to add comment