Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The Shame Box ~Chat n' Box em'!~
- -- @Acecateer
- local Player = game.Players.LocalPlayer
- local Boxes = workspace:FindFirstChild("BoxContainer") or Instance.new("Model", workspace)
- Boxes.Name = "BoxContainer"
- local AceTween = function(Instance, c0, c1, Frames) -- Modified version for Primary part CFraming
- local cDiff = c0:toObjectSpace(c1)
- local cDiffaX, cDiffaY, cDiffaZ = cDiff:toEulerAnglesXYZ()
- for i = 0, Frames do
- Instance:SetPrimaryPartCFrame(c0)
- Instance:SetPrimaryPartCFrame(c0 * CFrame.new(cDiff.p/Frames * i) * CFrame.Angles(cDiffaX/Frames * i, cDiffaY/Frames * i, cDiffaZ/Frames * i))
- wait()
- end
- end
- local AceTweenNum = function(Instance, Property, c0, c1, Frames)
- local Diff = c1 - c0
- for i = 0, Frames do
- Instance[Property] = c0
- local cDiff = c0 + (Diff * i)/Frames
- Instance[Property] = cDiff
- wait()
- end
- end
- -- Create function
- local Create = function(ty)
- return function(data)
- local obj = Instance.new(ty)
- for k, v in pairs(data) do
- if type(k) == 'number' then
- v.Parent = obj
- else
- obj[k] = v
- end
- end
- return obj
- end
- end
- local CreateBox = function()
- local Box = Create'Model'{
- Name = "Shame Box";
- Create'Part'{
- Anchored = true;
- TopSurface = Enum.SurfaceType.Smooth;
- BrickColor = BrickColor.new(1014);
- Size = Vector3.new(9.40000057, 0.200000003, 9.80000114);
- formFactor = Enum.FormFactor.Custom;
- BottomSurface = Enum.SurfaceType.Smooth;
- 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);
- Name = "TOP";
- Position = Vector3.new(40.433094, 9.58693981, 87.7222824);
- Create'Decal'{
- Face = Enum.NormalId.Top;
- Texture = "http://www.roblox.com/asset/?id=77964053";
- };
- Create'SurfaceGui'{
- Face = "Top";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- Create'SurfaceGui'{
- Face = "Bottom";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- };
- Create'Part'{
- Anchored = true;
- TopSurface = Enum.SurfaceType.Smooth;
- BrickColor = BrickColor.new(1014);
- Size = Vector3.new(0.200000003, 9.40000057, 9.40000153);
- formFactor = Enum.FormFactor.Custom;
- BottomSurface = Enum.SurfaceType.Smooth;
- 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);
- Position = Vector3.new(35.6321754, 4.78790379, 87.7207947);
- Create'Decal'{
- Face = Enum.NormalId.Left;
- Texture = "http://www.roblox.com/asset/?id=77964053";
- };
- Create'SurfaceGui'{
- Face = "Right";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- Create'SurfaceGui'{
- Face = "Left";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- };
- Create'Part'{
- Anchored = true;
- TopSurface = Enum.SurfaceType.Smooth;
- BrickColor = BrickColor.new(1014);
- Size = Vector3.new(0.200000003, 9.40000057, 9.40000153);
- formFactor = Enum.FormFactor.Custom;
- BottomSurface = Enum.SurfaceType.Smooth;
- 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);
- Position = Vector3.new(40.4321823, 4.78841782, 83.1207657);
- Create'Decal'{
- Face = Enum.NormalId.Right;
- Texture = "http://www.roblox.com/asset/?id=77964053";
- };
- Create'SurfaceGui'{
- Face = "Right";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- Create'SurfaceGui'{
- Face = "Left";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- };
- Create'Part'{
- Anchored = true;
- TopSurface = Enum.SurfaceType.Smooth;
- BrickColor = BrickColor.new(1014);
- Size = Vector3.new(0.200000003, 9.40000057, 9.40000153);
- formFactor = Enum.FormFactor.Custom;
- BottomSurface = Enum.SurfaceType.Smooth;
- 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);
- Position = Vector3.new(40.4321861, 4.78553581, 92.3207779);
- Create'Decal'{
- Face = Enum.NormalId.Left;
- Texture = "http://www.roblox.com/asset/?id=77964053";
- };
- Create'SurfaceGui'{
- Face = "Right";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- Create'SurfaceGui'{
- Face = "Left";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- };
- Create'Part'{
- Anchored = true;
- TopSurface = Enum.SurfaceType.Smooth;
- BrickColor = BrickColor.new(1014);
- Size = Vector3.new(0.200000003, 9.40000057, 9.40000153);
- formFactor = Enum.FormFactor.Custom;
- BottomSurface = Enum.SurfaceType.Smooth;
- 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);
- Position = Vector3.new(45.232193, 4.78611183, 87.7207947);
- Create'SurfaceGui'{
- Face = "Right";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- Create'Decal'{
- Face = Enum.NormalId.Right;
- Texture = "http://www.roblox.com/asset/?id=77964053";
- };
- Create'SurfaceGui'{
- Face = "Left";
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size36;
- Text = "SHAME BOX";
- Size = UDim2.new(0.5, 0, 0.1, 0);
- TextColor3 = Color3.new(0, 0, 0);
- TextWrap = true;
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0.25, 0, 0.45, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'ImageLabel'{
- Image = "rbxassetid://164654841";
- Size = UDim2.new(0.4, 0, 0.15, 0);
- Position = UDim2.new(0.3, 0, 0.425, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- };
- };
- return Box
- end
- local findPlayer = function(name)
- for _, player in ipairs(game.Players:GetPlayers()) do
- if player.Name:lower():find(name:lower()) then
- return player
- end
- end
- end
- local onChatted = function(message)
- if message:sub(1, 4) == "box/" then
- local Victim = findPlayer(message:sub(5))
- if Victim ~= nil then
- local Character = Victim.Character ~= nil and Victim.Character or Victim.CharacterAdded:wait()
- local Torso = Character:FindFirstChild("Torso")
- if Torso then
- local Box = CreateBox()
- Box.Name = (Victim.Name.."'s Box")
- -- Create PrimaryPart
- local ModelSize = Box:GetExtentsSize()
- local ModelCFrame = Box:GetModelCFrame()
- local Primary = Instance.new("Part", Box)
- Primary.Name = "Primary"
- Primary.Size = ModelSize
- Primary.CFrame = ModelCFrame
- Primary.Transparency = 1
- Primary.CanCollide = false
- Primary.Anchored = true
- Box.PrimaryPart = Primary
- --
- -- Put the box in game
- Box:SetPrimaryPartCFrame(Torso.CFrame * CFrame.new(0, 50, 0))
- Box.Parent = Boxes
- AceTween(Box, Primary.CFrame, Torso.CFrame * CFrame.new(0, 1.887, 0), 8)
- -- Thud sound
- local Sound2 = Instance.new("Sound", Primary)
- Sound2.SoundId = "http://www.roblox.com/asset/?id=191040613"
- Sound2:Play()
- game.Debris:AddItem(Sound2, 1)
- end
- end
- end
- if message:sub(1, 6) == "unbox/" then
- local Victim = findPlayer(message:sub(7))
- if Victim ~= nil then
- for a,c in ipairs(Boxes:children()) do
- if c.Name == (Victim.Name.."'s Box") then
- c:Destroy()
- end
- end
- end
- end
- end
- Player.Chatted:connect(function(Message) onChatted(Message) end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement