Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.47 KB | None | 0 0
  1. -- The Shame Box ~Chat n' Box em'!~
  2. -- @Acecateer
  3.  
  4. local Player = game.Players.LocalPlayer
  5.  
  6. local Boxes = workspace:FindFirstChild("BoxContainer") or Instance.new("Model", workspace)
  7. Boxes.Name = "BoxContainer"
  8.  
  9. local AceTween = function(Instance, c0, c1, Frames) -- Modified version for Primary part CFraming
  10. local cDiff = c0:toObjectSpace(c1)
  11. local cDiffaX, cDiffaY, cDiffaZ = cDiff:toEulerAnglesXYZ()
  12. for i = 0, Frames do
  13. Instance:SetPrimaryPartCFrame(c0)
  14. Instance:SetPrimaryPartCFrame(c0 * CFrame.new(cDiff.p/Frames * i) * CFrame.Angles(cDiffaX/Frames * i, cDiffaY/Frames * i, cDiffaZ/Frames * i))
  15. wait()
  16. end
  17. end
  18.  
  19. local AceTweenNum = function(Instance, Property, c0, c1, Frames)
  20. local Diff = c1 - c0
  21. for i = 0, Frames do
  22. Instance[Property] = c0
  23. local cDiff = c0 + (Diff * i)/Frames
  24. Instance[Property] = cDiff
  25. wait()
  26. end
  27. end
  28.  
  29. -- Create function
  30. local Create = function(ty)
  31. return function(data)
  32. local obj = Instance.new(ty)
  33. for k, v in pairs(data) do
  34. if type(k) == 'number' then
  35. v.Parent = obj
  36. else
  37. obj[k] = v
  38. end
  39. end
  40. return obj
  41. end
  42. end
  43.  
  44. local CreateBox = function()
  45. local Box = Create'Model'{
  46. Name = "Shame Box";
  47. Create'Part'{
  48. Anchored = true;
  49. TopSurface = Enum.SurfaceType.Smooth;
  50. BrickColor = BrickColor.new(1014);
  51. Size = Vector3.new(9.40000057, 0.200000003, 9.80000114);
  52. formFactor = Enum.FormFactor.Custom;
  53. BottomSurface = Enum.SurfaceType.Smooth;
  54. CFrame = CFrame.new(40.433094, 9.58693981, 87.7222824, -3.57627869e-007, 0.000189328566, 0.99999994, 0.000316165329, 0.99999994, -0.00018932845, -0.99999994, 0.000316165271, -4.76837158e-007);
  55. Name = "TOP";
  56. Position = Vector3.new(40.433094, 9.58693981, 87.7222824);
  57. Create'Decal'{
  58. Face = Enum.NormalId.Top;
  59. Texture = "http://www.roblox.com/asset/?id=77964053";
  60. };
  61. Create'SurfaceGui'{
  62. Face = "Top";
  63. Create'TextLabel'{
  64. FontSize = Enum.FontSize.Size36;
  65. Text = "SHAME BOX";
  66. Size = UDim2.new(0.5, 0, 0.1, 0);
  67. TextColor3 = Color3.new(0, 0, 0);
  68. TextWrap = true;
  69. Font = Enum.Font.SourceSans;
  70. Position = UDim2.new(0.25, 0, 0.45, 0);
  71. BackgroundTransparency = 1;
  72. BackgroundColor3 = Color3.new(1, 1, 1);
  73. };
  74. Create'ImageLabel'{
  75. Image = "rbxassetid://164654841";
  76. Size = UDim2.new(0.4, 0, 0.15, 0);
  77. Position = UDim2.new(0.3, 0, 0.425, 0);
  78. BackgroundTransparency = 1;
  79. BackgroundColor3 = Color3.new(1, 1, 1);
  80. };
  81. };
  82. Create'SurfaceGui'{
  83. Face = "Bottom";
  84. Create'TextLabel'{
  85. FontSize = Enum.FontSize.Size36;
  86. Text = "SHAME BOX";
  87. Size = UDim2.new(0.5, 0, 0.1, 0);
  88. TextColor3 = Color3.new(0, 0, 0);
  89. TextWrap = true;
  90. Font = Enum.Font.SourceSans;
  91. Position = UDim2.new(0.25, 0, 0.45, 0);
  92. BackgroundTransparency = 1;
  93. BackgroundColor3 = Color3.new(1, 1, 1);
  94. };
  95. Create'ImageLabel'{
  96. Image = "rbxassetid://164654841";
  97. Size = UDim2.new(0.4, 0, 0.15, 0);
  98. Position = UDim2.new(0.3, 0, 0.425, 0);
  99. BackgroundTransparency = 1;
  100. BackgroundColor3 = Color3.new(1, 1, 1);
  101. };
  102. };
  103. };
  104. Create'Part'{
  105. Anchored = true;
  106. TopSurface = Enum.SurfaceType.Smooth;
  107. BrickColor = BrickColor.new(1014);
  108. Size = Vector3.new(0.200000003, 9.40000057, 9.40000153);
  109. formFactor = Enum.FormFactor.Custom;
  110. BottomSurface = Enum.SurfaceType.Smooth;
  111. CFrame = CFrame.new(35.6321754, 4.78790379, 87.7207947, 0.999999762, 0.00018924856, 3.27803434e-007, -0.000189248429, 0.99999994, -0.000316281716, -4.47009455e-007, 0.000316281716, 0.999999762);
  112. Position = Vector3.new(35.6321754, 4.78790379, 87.7207947);
  113. Create'Decal'{
  114. Face = Enum.NormalId.Left;
  115. Texture = "http://www.roblox.com/asset/?id=77964053";
  116. };
  117. Create'SurfaceGui'{
  118. Face = "Right";
  119. Create'TextLabel'{
  120. FontSize = Enum.FontSize.Size36;
  121. Text = "SHAME BOX";
  122. Size = UDim2.new(0.5, 0, 0.1, 0);
  123. TextColor3 = Color3.new(0, 0, 0);
  124. TextWrap = true;
  125. Font = Enum.Font.SourceSans;
  126. Position = UDim2.new(0.25, 0, 0.45, 0);
  127. BackgroundTransparency = 1;
  128. BackgroundColor3 = Color3.new(1, 1, 1);
  129. };
  130. Create'ImageLabel'{
  131. Image = "rbxassetid://164654841";
  132. Size = UDim2.new(0.4, 0, 0.15, 0);
  133. Position = UDim2.new(0.3, 0, 0.425, 0);
  134. BackgroundTransparency = 1;
  135. BackgroundColor3 = Color3.new(1, 1, 1);
  136. };
  137. };
  138. Create'SurfaceGui'{
  139. Face = "Left";
  140. Create'TextLabel'{
  141. FontSize = Enum.FontSize.Size36;
  142. Text = "SHAME BOX";
  143. Size = UDim2.new(0.5, 0, 0.1, 0);
  144. TextColor3 = Color3.new(0, 0, 0);
  145. TextWrap = true;
  146. Font = Enum.Font.SourceSans;
  147. Position = UDim2.new(0.25, 0, 0.45, 0);
  148. BackgroundTransparency = 1;
  149. BackgroundColor3 = Color3.new(1, 1, 1);
  150. };
  151. Create'ImageLabel'{
  152. Image = "rbxassetid://164654841";
  153. Size = UDim2.new(0.4, 0, 0.15, 0);
  154. Position = UDim2.new(0.3, 0, 0.425, 0);
  155. BackgroundTransparency = 1;
  156. BackgroundColor3 = Color3.new(1, 1, 1);
  157. };
  158. };
  159. };
  160. Create'Part'{
  161. Anchored = true;
  162. TopSurface = Enum.SurfaceType.Smooth;
  163. BrickColor = BrickColor.new(1014);
  164. Size = Vector3.new(0.200000003, 9.40000057, 9.40000153);
  165. formFactor = Enum.FormFactor.Custom;
  166. BottomSurface = Enum.SurfaceType.Smooth;
  167. CFrame = CFrame.new(40.4321823, 4.78841782, 83.1207657, -3.57627755e-007, 0.000189328566, 0.999999583, 0.000316165213, 0.99999994, -0.000189328377, -0.999999583, 0.000316165271, -4.76836988e-007);
  168. Position = Vector3.new(40.4321823, 4.78841782, 83.1207657);
  169. Create'Decal'{
  170. Face = Enum.NormalId.Right;
  171. Texture = "http://www.roblox.com/asset/?id=77964053";
  172. };
  173. Create'SurfaceGui'{
  174. Face = "Right";
  175. Create'TextLabel'{
  176. FontSize = Enum.FontSize.Size36;
  177. Text = "SHAME BOX";
  178. Size = UDim2.new(0.5, 0, 0.1, 0);
  179. TextColor3 = Color3.new(0, 0, 0);
  180. TextWrap = true;
  181. Font = Enum.Font.SourceSans;
  182. Position = UDim2.new(0.25, 0, 0.45, 0);
  183. BackgroundTransparency = 1;
  184. BackgroundColor3 = Color3.new(1, 1, 1);
  185. };
  186. Create'ImageLabel'{
  187. Image = "rbxassetid://164654841";
  188. Size = UDim2.new(0.4, 0, 0.15, 0);
  189. Position = UDim2.new(0.3, 0, 0.425, 0);
  190. BackgroundTransparency = 1;
  191. BackgroundColor3 = Color3.new(1, 1, 1);
  192. };
  193. };
  194. Create'SurfaceGui'{
  195. Face = "Left";
  196. Create'TextLabel'{
  197. FontSize = Enum.FontSize.Size36;
  198. Text = "SHAME BOX";
  199. Size = UDim2.new(0.5, 0, 0.1, 0);
  200. TextColor3 = Color3.new(0, 0, 0);
  201. TextWrap = true;
  202. Font = Enum.Font.SourceSans;
  203. Position = UDim2.new(0.25, 0, 0.45, 0);
  204. BackgroundTransparency = 1;
  205. BackgroundColor3 = Color3.new(1, 1, 1);
  206. };
  207. Create'ImageLabel'{
  208. Image = "rbxassetid://164654841";
  209. Size = UDim2.new(0.4, 0, 0.15, 0);
  210. Position = UDim2.new(0.3, 0, 0.425, 0);
  211. BackgroundTransparency = 1;
  212. BackgroundColor3 = Color3.new(1, 1, 1);
  213. };
  214. };
  215. };
  216. Create'Part'{
  217. Anchored = true;
  218. TopSurface = Enum.SurfaceType.Smooth;
  219. BrickColor = BrickColor.new(1014);
  220. Size = Vector3.new(0.200000003, 9.40000057, 9.40000153);
  221. formFactor = Enum.FormFactor.Custom;
  222. BottomSurface = Enum.SurfaceType.Smooth;
  223. CFrame = CFrame.new(40.4321861, 4.78553581, 92.3207779, -3.57627755e-007, 0.000189328566, 0.999999583, 0.000316165213, 0.99999994, -0.000189328377, -0.999999583, 0.000316165271, -4.76836988e-007);
  224. Position = Vector3.new(40.4321861, 4.78553581, 92.3207779);
  225. Create'Decal'{
  226. Face = Enum.NormalId.Left;
  227. Texture = "http://www.roblox.com/asset/?id=77964053";
  228. };
  229. Create'SurfaceGui'{
  230. Face = "Right";
  231. Create'TextLabel'{
  232. FontSize = Enum.FontSize.Size36;
  233. Text = "SHAME BOX";
  234. Size = UDim2.new(0.5, 0, 0.1, 0);
  235. TextColor3 = Color3.new(0, 0, 0);
  236. TextWrap = true;
  237. Font = Enum.Font.SourceSans;
  238. Position = UDim2.new(0.25, 0, 0.45, 0);
  239. BackgroundTransparency = 1;
  240. BackgroundColor3 = Color3.new(1, 1, 1);
  241. };
  242. Create'ImageLabel'{
  243. Image = "rbxassetid://164654841";
  244. Size = UDim2.new(0.4, 0, 0.15, 0);
  245. Position = UDim2.new(0.3, 0, 0.425, 0);
  246. BackgroundTransparency = 1;
  247. BackgroundColor3 = Color3.new(1, 1, 1);
  248. };
  249. };
  250. Create'SurfaceGui'{
  251. Face = "Left";
  252. Create'TextLabel'{
  253. FontSize = Enum.FontSize.Size36;
  254. Text = "SHAME BOX";
  255. Size = UDim2.new(0.5, 0, 0.1, 0);
  256. TextColor3 = Color3.new(0, 0, 0);
  257. TextWrap = true;
  258. Font = Enum.Font.SourceSans;
  259. Position = UDim2.new(0.25, 0, 0.45, 0);
  260. BackgroundTransparency = 1;
  261. BackgroundColor3 = Color3.new(1, 1, 1);
  262. };
  263. Create'ImageLabel'{
  264. Image = "rbxassetid://164654841";
  265. Size = UDim2.new(0.4, 0, 0.15, 0);
  266. Position = UDim2.new(0.3, 0, 0.425, 0);
  267. BackgroundTransparency = 1;
  268. BackgroundColor3 = Color3.new(1, 1, 1);
  269. };
  270. };
  271. };
  272. Create'Part'{
  273. Anchored = true;
  274. TopSurface = Enum.SurfaceType.Smooth;
  275. BrickColor = BrickColor.new(1014);
  276. Size = Vector3.new(0.200000003, 9.40000057, 9.40000153);
  277. formFactor = Enum.FormFactor.Custom;
  278. BottomSurface = Enum.SurfaceType.Smooth;
  279. CFrame = CFrame.new(45.232193, 4.78611183, 87.7207947, 0.999999762, 0.00018924856, 3.27803434e-007, -0.000189248429, 0.99999994, -0.000316281716, -4.47009455e-007, 0.000316281716, 0.999999762);
  280. Position = Vector3.new(45.232193, 4.78611183, 87.7207947);
  281. Create'SurfaceGui'{
  282. Face = "Right";
  283. Create'TextLabel'{
  284. FontSize = Enum.FontSize.Size36;
  285. Text = "SHAME BOX";
  286. Size = UDim2.new(0.5, 0, 0.1, 0);
  287. TextColor3 = Color3.new(0, 0, 0);
  288. TextWrap = true;
  289. Font = Enum.Font.SourceSans;
  290. Position = UDim2.new(0.25, 0, 0.45, 0);
  291. BackgroundTransparency = 1;
  292. BackgroundColor3 = Color3.new(1, 1, 1);
  293. };
  294. Create'ImageLabel'{
  295. Image = "rbxassetid://164654841";
  296. Size = UDim2.new(0.4, 0, 0.15, 0);
  297. Position = UDim2.new(0.3, 0, 0.425, 0);
  298. BackgroundTransparency = 1;
  299. BackgroundColor3 = Color3.new(1, 1, 1);
  300. };
  301. };
  302. Create'Decal'{
  303. Face = Enum.NormalId.Right;
  304. Texture = "http://www.roblox.com/asset/?id=77964053";
  305. };
  306. Create'SurfaceGui'{
  307. Face = "Left";
  308. Create'TextLabel'{
  309. FontSize = Enum.FontSize.Size36;
  310. Text = "SHAME BOX";
  311. Size = UDim2.new(0.5, 0, 0.1, 0);
  312. TextColor3 = Color3.new(0, 0, 0);
  313. TextWrap = true;
  314. Font = Enum.Font.SourceSans;
  315. Position = UDim2.new(0.25, 0, 0.45, 0);
  316. BackgroundTransparency = 1;
  317. BackgroundColor3 = Color3.new(1, 1, 1);
  318. };
  319. Create'ImageLabel'{
  320. Image = "rbxassetid://164654841";
  321. Size = UDim2.new(0.4, 0, 0.15, 0);
  322. Position = UDim2.new(0.3, 0, 0.425, 0);
  323. BackgroundTransparency = 1;
  324. BackgroundColor3 = Color3.new(1, 1, 1);
  325. };
  326. };
  327. };
  328. };
  329.  
  330. return Box
  331. end
  332.  
  333. local findPlayer = function(name)
  334. for _, player in ipairs(game.Players:GetPlayers()) do
  335. if player.Name:lower():find(name:lower()) then
  336. return player
  337. end
  338. end
  339. end
  340.  
  341. local onChatted = function(message)
  342. if message:sub(1, 4) == "box/" then
  343. local Victim = findPlayer(message:sub(5))
  344. if Victim ~= nil then
  345. local Character = Victim.Character ~= nil and Victim.Character or Victim.CharacterAdded:wait()
  346. local Torso = Character:FindFirstChild("Torso")
  347.  
  348. if Torso then
  349. local Box = CreateBox()
  350. Box.Name = (Victim.Name.."'s Box")
  351.  
  352. -- Create PrimaryPart
  353. local ModelSize = Box:GetExtentsSize()
  354. local ModelCFrame = Box:GetModelCFrame()
  355.  
  356. local Primary = Instance.new("Part", Box)
  357. Primary.Name = "Primary"
  358. Primary.Size = ModelSize
  359. Primary.CFrame = ModelCFrame
  360. Primary.Transparency = 1
  361. Primary.CanCollide = false
  362. Primary.Anchored = true
  363.  
  364. Box.PrimaryPart = Primary
  365. --
  366.  
  367. -- Put the box in game
  368. Box:SetPrimaryPartCFrame(Torso.CFrame * CFrame.new(0, 50, 0))
  369. Box.Parent = Boxes
  370.  
  371. AceTween(Box, Primary.CFrame, Torso.CFrame * CFrame.new(0, 1.887, 0), 8)
  372.  
  373. -- Thud sound
  374. local Sound2 = Instance.new("Sound", Primary)
  375. Sound2.SoundId = "http://www.roblox.com/asset/?id=191040613"
  376. Sound2:Play()
  377.  
  378. game.Debris:AddItem(Sound2, 1)
  379. end
  380. end
  381. end
  382. if message:sub(1, 6) == "unbox/" then
  383. local Victim = findPlayer(message:sub(7))
  384. if Victim ~= nil then
  385. for a,c in ipairs(Boxes:children()) do
  386. if c.Name == (Victim.Name.."'s Box") then
  387. c:Destroy()
  388. end
  389. end
  390. end
  391. end
  392. end
  393.  
  394. Player.Chatted:connect(function(Message) onChatted(Message) end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement