Ameno__GodOH

MandyHitBox

Oct 21st, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. -- Variáveis
  2. local targetObject = workspace:FindFirstChild("TrollPrism")
  3. local hitboxSize = Vector3.new(25, 25, 25) -- Tamanho da hitbox
  4.  
  5. -- Verifica se o objeto alvo existe
  6. if targetObject then
  7. -- Cria a hitbox
  8. local hitbox = Instance.new("Part")
  9. hitbox.Size = hitboxSize
  10. hitbox.Color = Color3.fromRGB(255, 0, 0) -- Cor vermelha
  11. hitbox.Anchored = true
  12. hitbox.CanCollide = false
  13. hitbox.Transparency = 0.5 -- Levemente transparente
  14. hitbox.Material = Enum.Material.SmoothPlastic
  15. hitbox.Parent = workspace
  16.  
  17. -- Função para adicionar textura em cada face da hitbox
  18. local function addTexture(face)
  19. local texture = Instance.new("Texture")
  20. texture.Texture = "rbxassetid://102681111497143" -- Substitua pelo ID de textura válido
  21. texture.StudsPerTileU = 25 -- Ajuste para repetir em toda a face
  22. texture.StudsPerTileV = 25
  23. texture.Face = face -- Aplica a textura na face específica
  24. texture.Parent = hitbox
  25. end
  26.  
  27. -- Adiciona a textura para todas as faces
  28. addTexture(Enum.NormalId.Front)
  29. addTexture(Enum.NormalId.Back)
  30. addTexture(Enum.NormalId.Left)
  31. addTexture(Enum.NormalId.Right)
  32. addTexture(Enum.NormalId.Top)
  33. addTexture(Enum.NormalId.Bottom)
  34.  
  35. -- Função para seguir o objeto alvo
  36. local function followTarget()
  37. while targetObject and targetObject.Parent do
  38. hitbox.CFrame = targetObject.CFrame -- Faz a hitbox seguir o objeto
  39. wait() -- Pequeno intervalo para atualizar a posição
  40. end
  41. end
  42.  
  43. -- Inicia a função de seguir
  44. followTarget()
  45. else
  46. warn("Objeto TrollPrism não encontrado no workspace!")
  47. end
Advertisement
Add Comment
Please, Sign In to add comment