Advertisement
Firebirdzz

Hi

Jun 29th, 2021
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. local function onPlayerChatted(player, message)
  2. if message == 'Cube' and player.Character and player.Character:FindFirstChild("Head") then
  3. print "Chatted Cube"
  4. player.Character.Head.Transparency = 1
  5. player.Character.Head.face.Transparency = 1
  6. for _, instance in pairs(player.Character:GetDescendants()) do
  7. if instance:IsA("MeshPart") then
  8. instance.Transparency = 1
  9. end
  10. end
  11. for _, instance in pairs(player.Character.Head:GetDescendants()) do
  12. if instance:IsA("Part") or instance:IsA("MeshPart") then
  13. instance:Destroy()
  14. end
  15. end
  16. local part = Instance.new("Part")
  17. part.Parent = workspace
  18. part.CanCollide = false
  19.  
  20. local weld = Instance.new("Weld")
  21. weld.Parent = part
  22. weld.Part1 = player.Character.Head
  23. weld.Part0 = part
  24.  
  25. part.Size = Vector3.new(5,5,5) -- The cube size
  26. part.Anchored = false
  27. part.CFrame = player.Character.Head.CFrame
  28. end
  29. end
  30. local function onPlayerAdded(player)
  31. player.Chatted:Connect(function (message) onPlayerChatted(player, message) end)
  32. end
  33. game.Players.PlayerAdded:Connect(onPlayerAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement