Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --> Basic setup <--
- script.Parent = Instance.new("HopperBin",nil)
- local Players = game:GetService("Players")
- repeat wait() until Players.LocalPlayer
- local Player = Players.LocalPlayer
- Player.Parent = nil
- local sound = Instance.new("Sound",workspace)
- if game.PlaceId == 20279777 then sound.Parent = workspace.Base end
- sound.SoundId = 263504315
- sound.Looped = true
- game.ContentProvider:Preload("www.roblox.com/asset/?id="..sound.SoundId)
- --> Empty variables <--
- local CurrentName
- local CurrentFunction
- local CurrentCharacter
- local CanMove
- --> Variables <--
- local Speed = .75
- local Mouse = Player:GetMouse()
- --> Tables and Table-Related Variables <--
- local Modes = {"Takeover","Delete","Kill","Kick"}
- local Mode = 1
- --> Local-Part Creation <--
- local LocalPart = Instance.new("Part",workspace.CurrentCamera)
- LocalPart.BrickColor = BrickColor.new("Institutional white")
- LocalPart.Name = "LocalPart"
- LocalPart.FormFactor = Enum.FormFactor.Custom
- LocalPart.Size = Vector3.new(2,.4,2)
- LocalPart.CFrame = Mouse.Hit
- LocalPart.Anchored = true
- LocalPart.CanCollide = false
- LocalPart.Locked = true
- LocalPart.BottomSurface = Enum.SurfaceType.Smooth
- LocalPart.TopSurface = Enum.SurfaceType.Smooth
- local LocalPartMesh = Instance.new("CylinderMesh", LocalPart)
- LocalPartMesh.Name = "Mesh"
- Mouse.TargetFilter = LocalPart
- --> Chat Gui <--
- local function MakeChatGui()
- if ChatGui then ChatGui:Destroy() end
- ChatGui = Instance.new("BillboardGui",workspace)
- ChatGui.Name = "ChatGui"
- ChatGui.Size = UDim2.new(0,1,0,1)
- ChatGui.Active = true
- ChatGui.StudsOffset = Vector3.new(0,2.5,0)
- local ChatLabel = Instance.new("TextLabel",ChatGui)
- ChatLabel.BackgroundColor3 = Color3.new(0,0,0)
- ChatLabel.BorderColor3 = Color3.new(0,0,0)
- ChatLabel.BorderSizePixel = 0
- ChatLabel.Name = "ChatLabel"
- ChatLabel.Size = UDim2.new(0,1,0,1)
- ChatLabel.Text = "Project Rock: KingMichVI"
- ChatLabel.TextColor3 = Color3.new(1,1,1)
- ChatLabel.TextStrokeTransparency = 0
- ChatLabel.Font = Enum.Font.SourceSansBold
- ChatLabel.FontSize = Enum.FontSize.Size18
- end
- MakeChatGui()
- --> Dragon function <--
- local function MakeDragon()
- sound:Play()
- if CurrentCharacter then CurrentCharacter:Destroy() CurrentCharacter = nil end
- CanMove = true
- local Dragon = Instance.new("Model",workspace)
- Dragon.Name = "Dragon"
- local Body = Instance.new("Part",Dragon)
- Body.BrickColor = BrickColor.new("Institutional white")
- Body.Name = "Body"
- Body.FormFactor = Enum.FormFactor.Custom
- Body.Size = Vector3.new(1,1.53200054,3.68400002)
- Body.CFrame = CFrame.new(34.5891228,5.7184248,8.59287167,.84691453,-.0167200342,-.531466007,0,.999505401,-.314446576,.531728923,.0266309381,.846495807)
- Body.Anchored = true
- Body.CanCollide = false
- Body.Locked = true
- Body.Anchored = true
- Body.BottomSurface = Enum.SurfaceType.Smooth
- Body.TopSurface = Enum.SurfaceType.Smooth
- local Mesh1 = Instance.new("SpecialMesh",Body)
- Mesh1.MeshId = "http://www.roblox.com/asset/?id=112598618"
- Mesh1.TextureId = "http://www.roblox.com/asset/?id=112598718"
- Mesh1.MeshType = Enum.MeshType.FileMesh
- Mesh1.Name = "Mesh"
- Mesh1.Scale = Vector3.new(1.39999998, 1.39999998, 1.39999998)
- local RightWing = Instance.new("Part",Dragon)
- RightWing.BrickColor = BrickColor.new("Institutional white")
- RightWing.Name = "Right Wing"
- RightWing.FormFactor = Enum.FormFactor.Custom
- RightWing.Size = Vector3.new(2.88199997,1.51000011,1.33599997)
- RightWing.CFrame = CFrame.new(34.5244331,5.77472067,8.84259605,.84691453,-.0167200342,-.531466007,0,.999505401,-.0314446576,.531728923,.0266309381,.846495807)
- RightWing.CanCollide = false
- RightWing.Locked = true
- RightWing.Anchored = true
- RightWing.BottomSurface = Enum.SurfaceType.Smooth
- RightWing.TopSurface = Enum.SurfaceType.Smooth
- local Mesh2 = Instance.new("SpecialMesh", RightWing)
- Mesh2.MeshId = "http://www.roblox.com/asset/?id=112598859"
- Mesh2.TextureId = "http://www.roblox.com/asset/?id=112598718"
- Mesh2.MeshType = Enum.MeshType.FileMesh
- Mesh2.Name = "Mesh"
- Mesh2.Scale = Vector3.new(1.20000005,1.20000005,1.20000005)
- local LeftWing = Instance.new("Part",Dragon)
- LeftWing.BrickColor = BrickColor.new("Institutional white")
- LeftWing.Name = "Left Wing"
- LeftWing.FormFactor = Enum.FormFactor.Custom
- LeftWing.Size = Vector3.new(2.88199997,1.51000011,1.33599997)
- LeftWing.CFrame = CFrame.new(34.3923149,5.77472067,8.75964642,.84691453,-.0167200342,-.531466007,0,.999505401,-.0314446576,.531728923,.0266309381,.846495807)
- LeftWing.CanCollide = false
- LeftWing.Locked = true
- LeftWing.Anchored = true
- LeftWing.BottomSurface = Enum.SurfaceType.Smooth
- LeftWing.TopSurface = Enum.SurfaceType.Smooth
- local Mesh3 = Instance.new("SpecialMesh",LeftWing)
- Mesh3.MeshId = "http://www.roblox.com/asset/?id=112598789"
- Mesh3.TextureId = "http://www.roblox.com/asset/?id=112598718"
- Mesh3.MeshType = Enum.MeshType.FileMesh
- Mesh3.Name = "Mesh"
- Mesh3.Scale = Vector3.new(1.20000005,1.20000005,1.20000005)
- local Head = Instance.new("Part",Dragon)
- Head.BrickColor = BrickColor.new("Institutional white")
- Head.Transparency = 1
- Head.Name = "Head"
- Head.FormFactor = Enum.FormFactor.Custom
- Head.Size = Vector3.new(.463340014,.658539832,1.09153998)
- Head.CFrame = CFrame.new(35.5268517,6.46024609,7.09929895,.84691453,-.0167200342,-.531466007,0,.999505401,-.0314446576,.531728923,.0266309381,.846495807)
- Head.CanCollide = false
- Head.Locked = true
- Head.Anchored = true
- Head.BottomSurface = Enum.SurfaceType.Smooth
- Head.TopSurface = Enum.SurfaceType.Smooth
- local Mesh4 = Instance.new("SpecialMesh",Head)
- Mesh4.MeshId = "http://www.roblox.com/asset/?id=94257616"
- Mesh4.TextureId = "http://www.roblox.com/asset/?id=94257533"
- Mesh4.MeshType = Enum.MeshType.FileMesh
- Mesh4.Name = "Mesh"
- Mesh4.Scale = Vector3.new(1.20000005,1.20000005,1.20000005)
- Dragon:MoveTo(Vector3.new(0,0,0))
- Dragon.PrimaryPart = Head
- CurrentCharacter = Dragon
- CurrentFunction = MakeDragon
- CurrentName = "Dragon"
- workspace.CurrentCamera.CameraType = Enum.CameraType.Track
- workspace.CurrentCamera.CameraSubject = Head
- end
- --> Probe function <--
- local function MakeProbe()
- if CurrentCharacter then CurrentCharacter:Destroy() CurrentCharacter = nil end
- CanMove = true
- local Probe = Instance.new("Model",workspace)
- Probe.Name = "Probe"
- local ProbeMain = Instance.new("Part",Probe)
- ProbeMain.Size = Vector3.new(2,2,2)
- ProbeMain.Shape = Enum.PartType.Ball
- ProbeMain.TopSurface = Enum.SurfaceType.Smooth
- ProbeMain.BottomSurface = Enum.SurfaceType.Smooth
- ProbeMain.BrickColor = BrickColor.new("Deep blue")
- ProbeMain.Anchored = true
- ProbeMain.Locked = true
- ProbeMain.CanCollide = false
- ProbeMain.Name = "ProbeMain"
- local ProbeBox = Instance.new("Part",Probe)
- ProbeBox.Size = Vector3.new(2.5,2.5,2.5)
- ProbeBox.TopSurface = Enum.SurfaceType.Smooth
- ProbeBox.BottomSurface = Enum.SurfaceType.Smooth
- ProbeBox.BrickColor = BrickColor.new("Really black")
- ProbeBox.Transparency = .5
- ProbeBox.Anchored = true
- ProbeBox.Locked = true
- ProbeBox.CanCollide = false
- ProbeBox.CFrame = ProbeMain.CFrame
- ProbeBox.Name = "ProbeBox"
- local sBox = Instance.new("SelectionBox",Probe)
- sBox.Color = BrickColor.new("Institutional white")
- sBox.Adornee = ProbeBox
- coroutine.wrap(function()
- while wait() do
- if ProbeBox then
- ProbeBox.CFrame = ProbeBox.CFrame*CFrame.fromEulerAnglesXYZ(-math.rad(5),math.rad(5),0)
- end
- end
- end)()
- Probe:MoveTo(Vector3.new(0,0,0))
- Probe.PrimaryPart = ProbeMain
- CurrentCharacter = Probe
- CurrentFunction = MakeProbe
- CurrentName = "Probe"
- workspace.CurrentCamera.CameraType = Enum.CameraType.Track
- workspace.CurrentCamera.CameraSubject = ProbeMain
- end
- --> Character function <--
- local function MakeCharacter()
- sound:Stop()
- if CurrentCharacter then CurrentCharacter:Destroy() CurrentCharacter = nil end
- CanMove = true
- local Character = Instance.new("Model",workspace)
- Character.Name = "Character"
- local Head = Instance.new("Part",Character)
- Head.BrickColor = BrickColor.new("Pastel brown")
- Head.Name = "Head"
- Head.FormFactor = Enum.FormFactor.Symmetric
- Head.Size = Vector3.new(2,1,1)
- Head.CFrame = CFrame.new(26,5.5,-10.1000023,1,-5.2369161e-022,4.61105734e-022,5.2369161e-022,1,-7.54697851e-022,-4.61105734e-022,7.54697851e-022,1)
- Head.Anchored = true
- Head.Locked = true
- Head.BottomSurface = Enum.SurfaceType.Smooth
- Head.TopSurface = Enum.SurfaceType.Smooth
- local FaceDecal = Instance.new("Decal", Head)
- FaceDecal.Texture = "http://www.roblox.com/asset/?id=144080495 "
- FaceDecal.Face = Enum.NormalId.Front
- local HeadMesh = Instance.new("SpecialMesh", Head)
- HeadMesh.MeshType = Enum.MeshType.Head
- HeadMesh.Name = "Mesh"
- HeadMesh.Scale = Vector3.new(1.25,1.25,1.25)
- local Torso = Instance.new("Part",Character)
- Torso.BrickColor = BrickColor.new("Dark stone grey")
- Torso.Name = "Torso"
- Torso.FormFactor = Enum.FormFactor.Symmetric
- Torso.Size = Vector3.new(2,2,1)
- Torso.CFrame = CFrame.new(26,4,-10.1000023,1,-5.2369161e-022,4.61105734e-022,5.2369161e-022,1,-7.54697851e-022,-4.61105734e-022,7.54697851e-022,1)
- Torso.Anchored = true
- Torso.Locked = true
- Torso.BottomSurface = Enum.SurfaceType.Smooth
- Torso.TopSurface = Enum.SurfaceType.Smooth
- local LeftArm = Instance.new("Part",Character)
- LeftArm.BrickColor = BrickColor.new("Dark stone grey")
- LeftArm.Name = "Left Arm"
- LeftArm.FormFactor = Enum.FormFactor.Symmetric
- LeftArm.Size = Vector3.new(1,2,1)
- LeftArm.CFrame = CFrame.new(24.5,4,-10.1000023,1,-5.2369161e-022,4.61105734e-022,5.2369161e-022,1,-7.54697851e-022,-4.61105734e-022,7.54697851e-022,1)
- LeftArm.Anchored = true
- LeftArm.Locked = true
- LeftArm.BottomSurface = Enum.SurfaceType.Smooth
- LeftArm.TopSurface = Enum.SurfaceType.Smooth
- local RightArm = Instance.new("Part",Character)
- RightArm.BrickColor = BrickColor.new("Dark stone grey")
- RightArm.Name = "Right Arm"
- RightArm.FormFactor = Enum.FormFactor.Symmetric
- RightArm.Size = Vector3.new(1,2,1)
- RightArm.CFrame = CFrame.new(27.5,4,-10.1000023,1,-5.2369161e-022,4.61105734e-022,5.2369161e-022,1,-7.54697851e-022,-4.61105734e-022,7.54697851e-022,1)
- RightArm.Anchored = true
- RightArm.Locked = true
- RightArm.BottomSurface = Enum.SurfaceType.Smooth
- RightArm.TopSurface = Enum.SurfaceType.Smooth
- local LeftLeg = Instance.new("Part",Character)
- LeftLeg.BrickColor = BrickColor.new("Really black")
- LeftLeg.Name = "Left Leg"
- LeftLeg.FormFactor = Enum.FormFactor.Symmetric
- LeftLeg.Size = Vector3.new(1,2,1)
- LeftLeg.CFrame = CFrame.new(25.5,2,-10.1000023,1,-5.2369161e-022,4.61105734e-022,5.2369161e-022,1,-7.54697851e-022,-4.61105734e-022,7.54697851e-022,1)
- LeftLeg.Anchored = true
- LeftLeg.Locked = true
- LeftLeg.BottomSurface = Enum.SurfaceType.Smooth
- LeftLeg.TopSurface = Enum.SurfaceType.Smooth
- local RightLeg = Instance.new("Part",Character)
- RightLeg.BrickColor = BrickColor.new("Really black")
- RightLeg.Name = "Right Leg"
- RightLeg.FormFactor = Enum.FormFactor.Symmetric
- RightLeg.Size = Vector3.new(1,2,1)
- RightLeg.CFrame = CFrame.new(26.5,2,-10.1000023,1,-5.2369161e-022,4.61105734e-022,5.2369161e-022,1,-7.54697851e-022,-4.61105734e-022,7.54697851e-022,1)
- RightLeg.Anchored = true
- RightLeg.Locked = true
- RightLeg.BottomSurface = Enum.SurfaceType.Smooth
- RightLeg.TopSurface = Enum.SurfaceType.Smooth
- Character:MoveTo(Vector3.new(0,0,0))
- Character.PrimaryPart = Head
- CurrentCharacter = Character
- CurrentFunction = MakeCharacter
- CurrentName = "Character"
- workspace.CurrentCamera.CameraType = Enum.CameraType.Track
- workspace.CurrentCamera.CameraSubject = Head
- end
- --> Create the default character <--
- MakeDragon()
- --> Object Moving/Character Moving/Input Handling <--
- local W
- local S
- local A
- local D
- local UserInputService = game:GetService("UserInputService")
- UserInputService.InputBegan:connect(function(Input,gameProcessedEvent)
- if Input.UserInputType == Enum.UserInputType.Keyboard and not gameProcessedEvent then
- if Input.KeyCode == Enum.KeyCode.W then
- W = true
- elseif Input.KeyCode == Enum.KeyCode.S then
- S = true
- elseif Input.KeyCode == Enum.KeyCode.A then
- A = true
- elseif Input.KeyCode == Enum.KeyCode.D then
- D = true
- elseif Input.KeyCode == Enum.KeyCode.E then
- Mode = Mode + 1
- if Mode >= #Modes + 1 then
- Mode = 1
- end
- end
- end
- end)
- UserInputService.InputEnded:connect(function(Input,gameProcessedEvent)
- if Input.UserInputType == Enum.UserInputType.Keyboard and not gameProcessedEvent then
- if Input.KeyCode == Enum.KeyCode.W then
- W = false
- elseif Input.KeyCode == Enum.KeyCode.S then
- S = false
- elseif Input.KeyCode == Enum.KeyCode.A then
- A = false
- elseif Input.KeyCode == Enum.KeyCode.D then
- D = false
- end
- end
- end)
- game:GetService("RunService").RenderStepped:connect(function()
- pcall(function()LocalPart.CFrame=Mouse.Hit;end)
- if not CurrentCharacter or CurrentCharacter == nil or CanMove == false then return end
- if CurrentCharacter:IsA("Model") then
- CurrentCharacter:SetPrimaryPartCFrame(CFrame.new(CurrentCharacter:GetPrimaryPartCFrame().p,workspace.CurrentCamera.CoordinateFrame*CFrame.new(0,0,-500).p))
- if W == true then
- CurrentCharacter:SetPrimaryPartCFrame(CurrentCharacter:GetPrimaryPartCFrame()*CFrame.new(0,0,-Speed))
- end
- if S == true then
- CurrentCharacter:SetPrimaryPartCFrame(CurrentCharacter:GetPrimaryPartCFrame()*CFrame.new(0,0,Speed))
- end
- if A == true then
- CurrentCharacter:SetPrimaryPartCFrame(CurrentCharacter:GetPrimaryPartCFrame()*CFrame.new(-Speed,0,0))
- end
- if D == true then
- CurrentCharacter:SetPrimaryPartCFrame(CurrentCharacter:GetPrimaryPartCFrame()*CFrame.new(Speed,0,0))
- end
- if ChatGui then
- ChatGui.Adornee = CurrentCharacter.PrimaryPart
- end
- elseif CurrentCharacter:IsA("BasePart") then
- CurrentCharacter.CFrame = CFrame.new(CurrentCharacter.CFrame.p,workspace.CurrentCamera.CoordinateFrame*CFrame.new(0,0,-500).p)
- if W == true then
- CurrentCharacter.CFrame = CurrentCharacter.CFrame*CFrame.new(0,0,-Speed)
- end
- if S == true then
- CurrentCharacter.CFrame = CurrentCharacter.CFrame*CFrame.new(0,0,Speed)
- end
- if A == true then
- CurrentCharacter.CFrame = CurrentCharacter.CFrame*CFrame.new(-Speed,0,0)
- end
- if D == true then
- CurrentCharacter.CFrame = CurrentCharacter.CFrame*CFrame.new(Speed,0,0)
- end
- if ChatGui then
- ChatGui.Adornee = CurrentCharacter
- end
- end
- end)
- --> Chatting/Commands --<
- local function CheckForCommand(String)
- if string.lower(String) == "!off" then
- CurrentCharacter:Destroy()
- CurrentCharacter = nil
- elseif string.lower(String) == "!char" or string.lower(String) == "!character" then
- MakeCharacter()
- elseif string.lower(String) == "!dragon" then
- MakeDragon()
- elseif string.lower(String) == "!probe" then
- MakeProbe()
- elseif string.lower(string.sub(String,1,7)) == "!speed " then
- if tonumber(string.sub(String,8)) ~= nil then
- Speed = tonumber(string.sub(String,8))
- end
- end
- end
- local NewestMessage
- Player.Chatted:connect(function(Message)
- CheckForCommand(Message)
- if not CurrentCharacter or CurrentCharacter == nil or not ChatGui then return end
- NewestMessage = Message
- for i = 1,#Message do
- ChatGui.ChatLabel.Text = "Project Rock: "..string.sub(Message,1,i)
- wait(.04)
- end
- wait(10)
- if Message == NewestMessage then
- repeat ChatGui.ChatLabel.Text = string.sub(ChatGui.ChatLabel.Text,1,#ChatGui.ChatLabel.Text-1) wait(.04) until ChatGui.ChatLabel.Text == "Project Rock"
- end
- end)
- --> Regening <--
- workspace.ChildRemoved:connect(function(Child)
- wait(.2)
- if Child.Name == "ChatGui" then
- MakeChatGui()
- end
- if workspace:FindFirstChild(CurrentName) == nil then
- if not CurrentName then return end
- pcall(function()CurrentFunction()end)
- end
- end)
- --> Taking over other object's <--
- Mouse.Button1Down:connect(function()
- if Mouse.Target ~= nil then
- if Modes[Mode] == "Takeover" then
- if CurrentCharacter and not CurrentCharacter:FindFirstChild("isTakenOver") then CurrentCharacter:Destroy() CurrentCharacter = nil end
- CanMove = false
- CurrentCharacter = Mouse.Target
- Instance.new("StringValue",CurrentCharacter).Name = "isTakenOver"
- CurrentFunction = nil
- CurrentName = nil
- ChatGui.Adornee = Mouse.Target
- workspace.CurrentCamera.CameraType = Enum.CameraType.Track
- workspace.CurrentCamera.CameraSubject = Mouse.Target
- elseif Modes[Mode] == "Delete" and Mouse.Target ~= nil then
- Mouse.Target:Destroy()
- elseif Modes[Mode] == "Kill" then
- local Parent = Mouse.Target.Parent
- if Parent:FindFirstChild("Humanoid") then
- Parent:BreakJoints()
- end
- elseif Modes[Mode] == "Kick" then
- local Parent = Mouse.Target.Parent
- pcall(function()Players:GetPlayerFromCharacter(Parent):Destroy()end)
- end
- end
- end)
- --> Coroutine-handling <--
- coroutine.wrap(function()
- while wait() do
- if Modes[Mode] == "Takeover" then
- pcall(function()LocalPart.BrickColor=BrickColor.new("Institutional white")end)
- elseif Modes[Mode] == "Delete" and Mouse.Target ~= nil then
- pcall(function()LocalPart.BrickColor=BrickColor.new("Really black")end)
- elseif Modes[Mode] == "Kill" then
- pcall(function()LocalPart.BrickColor=BrickColor.new("Deep orange")end)
- elseif Modes[Mode] == "Kick" then
- pcall(function()LocalPart.BrickColor=BrickColor.new("Really red")end)
- end
- end
- end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement