Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- asswiperockets = Instance.new("Tool",game.Players.LocalPlayer.Backpack)
- asswiperockets.GripPos = Vector3.new(-0.75,-0.5,0.10000000149012)
- asswiperockets.Grip = CFrame.new(-0.75,-0.5,0.10000000149012) * CFrame.Angles(0, 1.5707963705063, 0)
- asswiperockets.TextureId = "http://www.roblox.com/asset/?id=50194736"
- asswiperockets.GripForward = Vector3.new(-1,0,-0)
- asswiperockets.Name = "Asswiperockets"
- asswiperockets.GripRight = Vector3.new(0,0,-1)
- explosion = Instance.new("Sound",asswiperockets)
- explosion.Name = "Explosion"
- explosion.Volume = 1
- explosion.SoundId = "rbxasset://sounds/collide.wav"
- swoosh = Instance.new("Sound",asswiperockets)
- swoosh.Looped = true
- swoosh.Name = "Swoosh"
- swoosh.Volume = 0.69999998807907
- swoosh.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
- handle = Instance.new("Part",asswiperockets)
- handle.FormFactor = Enum.FormFactor.Plate
- handle.TopSurface = Enum.SurfaceType.Smooth
- handle.Reflectance = 0.40000000596046
- handle.Size = Vector3.new(4,0.80000001192093,1)
- handle.Name = "Handle"
- handle.CFrame = CFrame.new(-5.9995460510254,0.48450919985771,1.4021196365356) * CFrame.Angles(-1.5678633451462, 0.0006661856896244, 3.1412653923035)
- handle.BrickColor = BrickColor.new("Dark stone grey")
- handle.Friction = 0.30000001192093
- handle.BottomSurface = Enum.SurfaceType.Smooth
- mesh = Instance.new("SpecialMesh",handle)
- mesh.Scale = Vector3.new(0.75,0.75,0.75)
- mesh.MeshId = "http://www.roblox.com/asset/?id=1030777"
- mesh.TextureId = "http://www.roblox.com/asset/?id=1030776"
- mesh.MeshType = Enum.MeshType.FileMesh
- r = game:service("RunService")
- shaft = asswiperockets
- position = shaft.Position
- asswiperockets.Explosion.PlayOnRemove = true -- play explosion sound when projectile removed from game
- function fly()
- direction = asswiperockets.CFrame.lookVector
- position = shaft.position + direction * 3
- shaft.Velocity = 7*error
- end
- function blow()
- swoosh:stop()
- explosion = Instance.new("Explosion")
- explosion.Position = shaft.Position
- -- find instigator tag
- local creator = asswiperockets:findFirstChild("creator")
- if creator ~= nil then
- explosion.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
- end
- explosion.Parent = game.Workspace
- connection:disconnect()
- wait(.1)
- shaft:remove()
- end
- function onPlayerBlownUp(part, distance, creator)
- if part.Name == "Head" then
- local humanoid = part.Parent.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 = asswiperockets.Swoosh
- swoosh:play()
- d = t + 10.0 - s
- connection = shaft.Touched:connect(blow)
- while t < d do
- fly()
- t = r.Stepped:wait()
- end
- -- at max range
- asswiperockets.Explosion.PlayOnRemove = false
- swoosh:stop()
- shaft:remove()
- local Rocket = Instance.new("Part")
- local asswiperockets = asswiperockets
- Rocket.Locked = true
- Rocket.BackSurface = 3
- Rocket.BottomSurface = 3
- Rocket.FrontSurface = 3
- Rocket.LeftSurface = 3
- Rocket.RightSurface = 3
- Rocket.TopSurface = 3
- Rocket.Size = Vector3.new(1,1,4)
- Rocket.BrickColor = BrickColor.new(6)
- asswiperockets.Explosion:clone().Parent = Rocket
- asswiperockets.Swoosh:clone().Parent = Rocket
- function fire(vTarget, offset)
- local vCharacter = asswiperockets.Parent;
- local vHandle = asswiperockets:findFirstChild("Handle")
- if vHandle == nil then
- print("Handle not found")
- return
- end
- local dir = vTarget - vHandle.Position
- dir = computeDirection(dir)
- local missileCF = CFrame.new(vHandle.Position, vHandle.Position + dir)
- local missile = Rocket:clone()
- local color = math.random(1,32)
- missile.BrickColor = BrickColor.new(color)
- print(color)
- missile.CFrame = missileCF * offset
- local creator_tag = Instance.new("ObjectValue")
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- if vPlayer == nil then
- print("Player not found")
- else
- if (vPlayer.Neutral == false) then -- nice touch
- missile.BrickColor = vPlayer.TeamColor
- end
- end
- creator_tag.Value =vPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = missile
- 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
- asswiperockets.Enabled = true
- function onActivated()
- if not asswiperockets.Enabled then
- return
- end
- asswiperockets.Enabled = true
- local character = asswiperockets.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- local targetPos = humanoid.TargetPoint
- for i=-15,15,5 do
- fire(targetPos, CFrame.new(i,0,-9))
- end
- wait(0)
- asswiperockets.Enabled = true
- end
- asswiperockets.Activated:connect(onActivated)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement