lol375090

well...

Oct 11th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. Asset = "http://www.roblox.com/Thumbs/Asset.ashx?x=420&y=230&assetId="
  2.  
  3. me = game.Players.CautionusSky45
  4. char = me.Character
  5. torso = char.Torso
  6.  
  7. local brick = Instance.new("Part",workspace)
  8. brick.Anchored = true
  9. brick.formFactor = "Custom"
  10. brick.Size = Vector3.new(30, 20, 1)
  11. brick.CFrame = torso.CFrame * CFrame.new(0, 0, -40) * CFrame.Angles(0, math.pi, 0)
  12.  
  13. brick.Changed:connect(function()
  14. brick.Parent = workspace
  15. brick.CFrame = torso.CFrame * CFrame.new(0, 0, -40) * CFrame.Angles(0, math.pi, 0)
  16. end)
  17.  
  18. function AddDecal(id)
  19. local base = brick
  20. for _,v in pairs(base:children()) do if v:IsA("Decal") or v:IsA("Texture") then v:remove() end end
  21. local dec = Instance.new("Decal", base)
  22. dec.Texture = id
  23. dec.Face = "Front"
  24. end
  25.  
  26. function Chat(msg, plr)
  27. if string.sub(msg, 1, 8) == "picture/" then
  28. local num = tonumber(msg:sub(9))
  29. if num then
  30. AddDecal(Asset..num)
  31. end
  32. elseif string.sub(msg, 1, 4) == "hat/" then
  33. local char = plr.Character
  34. if char then
  35. local hat = {}
  36. for _,v in pairs(char:children()) do
  37. if v:IsA("Hat") then table.insert(hat, v) end
  38. end
  39. if #hat > 0 then
  40. hat = hat[math.random(1,#hat)]
  41. local handle = hat:findFirstChild("Handle")
  42. if handle then
  43. local mesh = nil
  44. for i,v in pairs(handle:children()) do
  45. if v:IsA("SpecialMesh") then mesh = v break end
  46. end
  47. if mesh then
  48. AddDecal(mesh.TextureId)
  49. end
  50. end
  51. end
  52. end
  53. elseif msg == "remolol" then
  54. script.Disabled = true
  55. end
  56. end
  57.  
  58. for _,v in pairs(game.Players:GetPlayers()) do v.Chatted:connect(function(msg) Chat(msg, v) end) end
  59. game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) Chat(msg, p) end) end)
Add Comment
Please, Sign In to add comment