Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Script0 = Instance.new("Script")
- HopperBin1 = Instance.new("HopperBin")
- Part2 = Instance.new("Part")
- Script3 = Instance.new("Script")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- Script6 = Instance.new("Script")
- Script7 = Instance.new("Script")
- SpecialMesh8 = Instance.new("SpecialMesh")
- Script9 = Instance.new("Script")
- Script0.Name = "RocketScript"
- Script0.Parent = mas
- Script0.Disabled = true
- table.insert(cors,sandbox(Script0,function()
- r = game:service("RunService")
- shaft = script.Parent
- position = shaft.Position
- function fly()
- direction = shaft.CFrame.lookVector
- position = position + (direction*2)
- error = position - shaft.Position
- shaft.Velocity = error * 10
- end
- function blow()
- --swoosh:stop()
- explosion = Instance.new("Explosion")
- explosion.Position = shaft.Position
- explosion.Parent = game.Workspace
- connection:disconnect()
- wait(.5)
- shaft:remove()
- end
- function onPlayerBlownUp(part, distance, creator)
- if part.Name == "Head" then
- local humanoid = part.Parent:findFirstChild("Humanoid")
- tagHumanoid(humanoid, creator)
- end
- end
- function tagHumanoid(humanoid, creator)
- -- tag does not need to expire iff all explosions lethal
- if creator ~= nil then
- local new_tag = creator:clone()
- new_tag.Parent = humanoid
- end
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- t, s = r.Stepped:wait()
- --swoosh = script.Parent.Swoosh
- --swoosh:play()
- d = t + 10.0 - s
- while t < d do
- fly()
- t = r.Stepped:wait()
- end
- script.Parent.Explosion.PlayOnRemove = false
- --swoosh:stop()
- shaft:remove()
- end))
- HopperBin1.Name = "Amaterasu"
- HopperBin1.Parent = mas
- HopperBin1.Active = true
- Part2.Name = "Rocket"
- Part2.Parent = HopperBin1
- Part2.BrickColor = BrickColor.new("Black")
- Part2.Transparency = 0.30000001192093
- Part2.Rotation = Vector3.new(180, 0, -180)
- Part2.Anchored = true
- Part2.FormFactor = Enum.FormFactor.Symmetric
- Part2.Shape = Enum.PartType.Ball
- Part2.Size = Vector3.new(4, 4, 4)
- Part2.CFrame = CFrame.new(69, 3.20000005, 40, -1, 0, -0, -0, 1, -0, -0, 0, -1)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part2.Position = Vector3.new(69, 3.20000005, 40)
- Part2.Orientation = Vector3.new(0, -180, 0)
- Part2.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Script3.Name = "RocketScript"
- Script3.Parent = Part2
- Script3.Disabled = true
- table.insert(cors,sandbox(Script3,function()
- r = game:service("RunService")
- shaft = script.Parent
- position = shaft.Position
- function fly()
- direction = shaft.CFrame.lookVector
- position = position + (direction*2)
- error = position - shaft.Position
- shaft.Velocity = error * 10
- end
- function blow()
- --swoosh:stop()
- explosion = Instance.new("Explosion")
- explosion.Position = shaft.Position
- explosion.Parent = game.Workspace
- connection:disconnect()
- wait(.5)
- shaft:remove()
- end
- function onPlayerBlownUp(part, distance, creator)
- if part.Name == "Head" then
- local humanoid = part.Parent:findFirstChild("Humanoid")
- tagHumanoid(humanoid, creator)
- end
- end
- function tagHumanoid(humanoid, creator)
- -- tag does not need to expire iff all explosions lethal
- if creator ~= nil then
- local new_tag = creator:clone()
- new_tag.Parent = humanoid
- end
- end
- function untagHumanoid(humanoid)
- if humanoid ~= nil then
- local tag = humanoid:findFirstChild("creator")
- if tag ~= nil then
- tag.Parent = nil
- end
- end
- end
- t, s = r.Stepped:wait()
- --swoosh = script.Parent.Swoosh
- --swoosh:play()
- d = t + 10.0 - s
- while t < d do
- fly()
- t = r.Stepped:wait()
- end
- script.Parent.Explosion.PlayOnRemove = false
- --swoosh:stop()
- shaft:remove()
- end))
- Sound4.Name = "Explosion"
- Sound4.Parent = Part2
- Sound4.SoundId = "rbxasset://sounds/collide.wav"
- Sound4.Volume = 1
- Sound4.PlayOnRemove = true
- Sound5.Name = "Swoosh"
- Sound5.Parent = Part2
- Sound5.SoundId = "http://www.roblox.com/asset/?id=12222095"
- Sound5.Volume = 0.69999998807907
- Sound5.Looped = true
- Script6.Parent = Part2
- table.insert(cors,sandbox(Script6,function()
- function stick(x, y)
- weld = Instance.new("Weld")
- weld.Part0 = x
- weld.Part1 = y
- local HitPos = x.Position
- local CJ = CFrame.new(HitPos)
- local C0 = x.CFrame:inverse() *CJ
- local C1 = y.CFrame:inverse() * CJ
- weld.C0 = C0
- weld.C1 = C1
- weld.Parent = x
- end
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if h~=nil then
- wait(0.001)
- h.Health = 0
- children = h.Parent:children()
- for i=1,#children do
- if(children[i].className == "Part" and children[i].Name ~= "Torso") then stick(children[i], h.Parent.Torso) end
- if(children[i].className == "Hat") then stick(children[i].Handle, h.Parent.Torso) end
- end
- h.Parent.Head.Velocity = h.Parent.Head.Velocity + Vector3.new(5,0,0)
- end
- end
- script.Parent.Touched:connect(onTouched)
- end))
- Script7.Parent = Part2
- table.insert(cors,sandbox(Script7,function()
- bin = script.Parent
- function onTouched()
- local n = part.Parent:findFirstChild("Humanoid")
- if n ~= nil then
- part.BrickColor = BrickColor.new(26)
- wait(.3)
- part.Transparency = .2
- wait(.1)
- part.Transparency = .4
- wait(.1)
- part.Transparency = .6
- wait(.1)
- part.Transparency = .8
- wait(.1)
- part.Parent = nil
- end
- end
- connection = bin.Touched:connect(onTouched)
- end))
- SpecialMesh8.Parent = Part2
- SpecialMesh8.MeshId = "http://www.roblox.com/Asset/?id=25212400"
- SpecialMesh8.Scale = Vector3.new(4, 4, 4)
- SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=22153324"
- SpecialMesh8.VertexColor = Vector3.new(2, 1.5, 0.300000012)
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- SpecialMesh8.Scale = Vector3.new(4, 4, 4)
- Script9.Name = "Launcher"
- Script9.Parent = HopperBin1
- table.insert(cors,sandbox(Script9,function()
- print("New rocket script loaded")
- bin = script.Parent
- function fire(target)
- local head = game.Players.LocalPlayer.Character:findFirstChild("Head")
- if head == nil then return end
- local dir = target - head.Position
- dir = computeDirection(dir)
- print("DIR X:", dir.x, "Y:", dir.y, "z:", dir.z)
- local missile = bin.Rocket:clone()
- local spawnPos = game.Players.LocalPlayer.Character.PrimaryPart.Position
- local pos = spawnPos + (dir * 9)
- --missile.Position = pos
- missile.CFrame = CFrame.new(pos, pos + dir)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = game.Players.LocalPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = missile
- missile.RocketScript.Disabled = false
- missile.Parent = game.Workspace
- end
- function computeDirection(vec)
- local lenSquared = vec.magnitude * vec.magnitude
- local invSqrt = 1 / math.sqrt(lenSquared)
- return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
- end
- enabled = true
- function onButton1Down(mouse)
- if not enabled then
- return
- end
- enabled = false
- mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
- -- find the best cf
- local cf = mouse.Hit
- --local v = cf.lookVector
- local target = cf.p
- fire(target)
- wait(1)
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- enabled = true
- end
- function onSelected(mouse)
- print("rocket selected")
- mouse.Icon = "rbxasset://textures\\GunCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- end
- bin.Selected:connect(onSelected)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Add Comment
Please, Sign In to add comment