Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- warn[[
- Mr.Brick's Pet Brick
- Made by projor22
- Keys:
- z-teleport
- x-attack
- p-refit
- q-reposition
- ]]
- wait()
- local player=owner
- local brickpart = {"Seat"}
- local brickname = "HumanoidRootPart"
- script.Parent=nil
- local NAME = "Brick< "..math.random()
- local mod = Instance.new("Model",workspace) mod.Name=NAME
- local brick = Instance.new(brickpart[math.random(1,#brickpart)],mod) brick.Name= brickname brick.Size=Vector3.new(2,1,4)
- local oldpos = nil
- oldpos=brick
- local respawn=true
- function camera()
- NLS([[local player = game:GetService("Players").LocalPlayer
- local mouse = player:GetMouse()
- local teleport=player.Backpack:WaitForChild("tels")
- local refitter=player.Backpack:WaitForChild("reset")
- local attack =player.Backpack:WaitForChild("attack")
- local repos = player.Backpack:WaitForChild("reposition")
- local brick=player.Character:FindFirstChild("HumanoidRootPart")
- local hum = Instance.new("Humanoid",player.Character) hum.MaxHealth = 300 hum.Health=300 hum.Name = "" hum.BreakJointsOnDeath=false hum.RequiresNeck=false hum.WalkSpeed=13
- workspace.CurrentCamera.CameraSubject = hum
- --workspace.CurrentCamera.CameraType = "Custom"
- local brickf = Instance.new("FlagStand",player.Character) brickf.Name= "Brick" brickf.Size=Vector3.new(2,1,4)
- local weld = Instance.new("Weld",brick) weld.Part0=brick weld.Part1= brickf
- brick.Transparency=2
- mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == 'z' then
- teleport:FireServer(mouse.Hit.p)
- end
- end)
- mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == 'x' then
- attack:FireServer(brick)
- end
- end)
- mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == 'p' then
- refitter:FireServer("reset")
- end
- end)
- mouse.KeyDown:connect(function(Key)
- Key = Key:lower()
- if Key == 'q' then
- repos:FireServer("repos")
- end
- end)
- ]],player.Backpack)
- end
- local character = player.Character
- if character then
- local head= character:FindFirstChild("Head")
- if head then
- brick.CFrame=head.CFrame player.Character=mod camera()
- else
- player.Character=mod camera()
- end
- end
- function resp()
- respawn=false
- local killr3=false
- player:LoadCharacter()
- local funnies = player.Character:FindFirstChildOfClass("Part")
- NAME = "Brick< "..math.random()
- local mod3 = Instance.new("Model",workspace) mod3.Name=NAME
- local brick3 = Instance.new(brickpart[math.random(1,#brickpart)],mod3) brick3.Name= brickname brick3.Size=Vector3.new(2,1,4) brick3.Position=funnies.Position
- player.Character=mod3
- oldpos=brick3
- local respawn3 = Instance.new("RemoteEvent",player.Backpack) respawn3.Name="reposition"
- local attack3 = Instance.new("RemoteEvent",player.Backpack) attack3.Name="attack"
- local tele3= Instance.new("RemoteEvent",player.Backpack) tele3.Name="tels"
- local refitter3 = Instance.new("RemoteEvent",player.Backpack) refitter3.Name="reset"
- camera()
- refitter3.OnServerEvent:connect(function(plr, omaga)
- refit()
- end)
- tele3.OnServerEvent:connect(function(plr, position)
- brick3.Position=position
- end)
- respawn3.OnServerEvent:connect(function(plr, repo)
- resp()
- end)
- brick3.Touched:Connect(function(Part)
- if killr3==true then
- if Part.Parent.ClassName == "Model" then
- Kill(Part.Parent)
- elseif Part.Parent.Parent.ClassName == "Model" then
- Kill(Part.Parent.Parent)
- end
- end
- end)
- attack3.OnServerEvent:connect(function(plr, plrpart)
- killr3=true
- effect(plrpart)
- wait(.5)
- killr3=false
- end)
- respawn=true
- end
- --remotes
- local respawn1 = Instance.new("RemoteEvent",player.Backpack) respawn1.Name="reposition"
- local refitter = Instance.new("RemoteEvent",player.Backpack) refitter.Name="reset"
- local attack = Instance.new("RemoteEvent",player.Backpack) attack.Name="attack"
- local tele= Instance.new("RemoteEvent",player.Backpack) tele.Name="tels"
- --remotes
- refitter.OnServerEvent:connect(function(plr, omaga)
- refit()
- end)
- tele.OnServerEvent:connect(function(plr, position)
- brick.Position=position
- end)
- respawn1.OnServerEvent:connect(function(plr, repo)
- resp()
- end)
- function Kill(die)
- die:BreakJoints()
- for i,g in pairs(die:GetDescendants()) do
- if g:IsA("BasePart") then
- local lol = nil
- lol = g
- lol.Color = Color3.fromRGB(170, 0, 0)
- lol.Transparency=.3
- lol.Material=Enum.Material.Glass
- local check = player.Character.HumanoidRootPart:FindFirstChild("mp3")
- if check then
- check.Volume = math.random(1,3)
- check:Play()
- else
- local sound = Instance.new("Sound",player.Character.HumanoidRootPart)
- sound.SoundId = "rbxassetid://516789356"
- sound.Volume = math.random(1,3)
- -- sound.PlayOnRemove=true
- sound.Name="mp3"
- end
- local bp = Instance.new("BodyVelocity",lol)
- bp.MaxForce = Vector3.new(0,math.huge,0)
- lol.Transparency=.6
- local died = Instance.new(brickpart[math.random(1,#brickpart)],workspace) died.Disabled=true died.CanCollide=true
- local mesher = lol:FindFirstChildOfClass("SpecialMesh")
- if mesher then
- mesher.Parent=died
- died.BrickColor=BrickColor.new("Really Black")
- mesher.TextureId=""
- else
- end
- g:Destroy()
- died.CFrame=lol.CFrame
- -- local particle1 = Instance.new("FlagStand",died) particle1.Size=Vector3.new(math.random(),math.random(),math.random()) particle1.Color=Color3.new() particle1.Transparency=.6 particle1.CFrame=died.CFrame
- died.Size=lol.Size
- died.Material=lol.Material
- died.Transparency=lol.Transparency
- died.BrickColor=lol.BrickColor
- died.Name="Shattered "..lol.Name
- end
- end
- end
- function effect(brickpart)
- local redpart = Instance.new("FlagStand",player.Character) redpart.Material=Enum.Material.Glass
- redpart.CanCollide=false redpart.Transparency=.5
- redpart.CFrame=brickpart.CFrame redpart.Color=Color3.new(0.666667, 0, 0) local welder = Instance.new("Weld",redpart) welder.Part0=redpart welder.Part1=brickpart
- redpart.Size=brickpart.Size + Vector3.new(.1,.1,.1)
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1)
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1)
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart.Size=redpart.Size + Vector3.new(.1,.1,.1) redpart.Transparency=redpart.Transparency + .09
- wait(.05)
- redpart:Destroy()
- end
- local killr = false
- brick.Touched:Connect(function(Part)
- if killr==true then
- if Part.Parent.ClassName == "Model" then
- Kill(Part.Parent)
- elseif Part.Parent.Parent.ClassName == "Model" then
- Kill(Part.Parent.Parent)
- end
- end
- end)
- attack.OnServerEvent:connect(function(plr, plrpart)
- killr=true
- effect(plrpart)
- wait(.5)
- killr=false
- end)
- function refit()
- local killr2=false
- NAME = "Brick< "..math.random()
- local mod2 = Instance.new("Model",workspace) mod2.Name=NAME
- local brick2 = Instance.new(brickpart[math.random(1,#brickpart)],mod2) brick2.Name= brickname brick2.Size=Vector3.new(2,1,4)
- brick2.CFrame=oldpos.CFrame
- oldpos=brick2
- player.Character=mod2
- local respawn2 = Instance.new("RemoteEvent",player.Backpack) respawn2.Name="reposition"
- local attack2 = Instance.new("RemoteEvent",player.Backpack) attack2.Name="attack"
- local tele2= Instance.new("RemoteEvent",player.Backpack) tele2.Name="tels"
- local refitter2 = Instance.new("RemoteEvent",player.Backpack) refitter2.Name="reset" camera()
- refitter2.OnServerEvent:connect(function(plr, omaga)
- refit()
- end)
- tele2.OnServerEvent:connect(function(plr, position)
- brick2.Position=position
- end)
- respawn2.OnServerEvent:connect(function(plr, repo)
- resp()
- end)
- brick2.Touched:Connect(function(Part)
- if killr2==true then
- if Part.Parent.ClassName == "Model" then
- Kill(Part.Parent)
- elseif Part.Parent.Parent.ClassName == "Model" then
- Kill(Part.Parent.Parent)
- end
- end
- end)
- attack2.OnServerEvent:connect(function(plr, plrpart)
- killr2=true
- effect(plrpart)
- wait(.5)
- killr2=false
- end)
- end
- local RunService = game:GetService("RunService")
- local RATE_PER_SECOND = 2
- RunService.Heartbeat:Connect(function(step)
- local increment = RATE_PER_SECOND * step
- local refit_pet = workspace:FindFirstChild(NAME)
- if refit_pet then
- local refit_brick = player.Character:FindFirstChild(brickname)
- if refit_brick then
- else
- if respawn==true then
- refit()
- end
- end
- else
- if respawn==true then
- refit()
- end
- end
- local torsomoment = player.Character:FindFirstChild(brickname)
- if torsomoment then
- torsomoment.Size=Vector3.new(2,1,4)
- torsomoment.Material=Enum.Material.Plastic
- torsomoment.BrickColor=BrickColor.new("Medium Stone Grey")
- end
- end)
Add Comment
Please, Sign In to add comment