null nil true -1 -0.75 0.25 0 0 1 0 1 -0 -1 0 -0 Silverbolt rbxasset://Textures/SilverboltClassic.png true false -0.5 0.5 0 0 -0.5 0.5 0 0 199 -205.5 12.8000002 -449 -0 0 1 -0 1 0 -1 0 0 true false 0.5 2 0.300000012 -0.5 0.5 0 0 -0.5 0.5 0 0 false 256 Handle 0.400000006 -0.5 0.5 0 0 0 0 0 -0.5 0.5 0 0 0 0 0 0 true 1 4 0.800000012 1 2 2 rbxasset://fonts/rocketlauncher.mesh 5 Mesh 0 0 0 0.75 0.75 0.75 rbxasset://textures/rocketlaunchertex.png 1 1 1 true false Local Gui local Tool = script.Parent; enabled = true function onButton1Down(mouse) if not enabled then return end enabled = false mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" wait(0.5) mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = true end function onEquippedLocal(mouse) if mouse == nil then print("Mouse not found") return end mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end Tool.Equipped:connect(onEquippedLocal) true false Explosion 1 -1 false rbxasset://sounds/collide.wav 1 true true Swoosh 1 -1 false rbxasset://sounds/Rocket whoosh 01.wav 0.699999988 true false RocketScript r = game:service("RunService") shaft = script.Parent position = shaft.Position script.Parent.Explosion.PlayOnRemove = true -- play explosion sound when projectile removed from game function fly() direction = shaft.CFrame.lookVector position = position + direction error = position - shaft.Position shaft.Velocity = 7*error end function blow() swoosh:stop() explosion = Instance.new("Explosion") explosion.Position = shaft.Position -- find instigator tag local creator = script.Parent: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 = script.Parent.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 script.Parent.Explosion.PlayOnRemove = false swoosh:stop() shaft:remove() true false Server Launcher local Rocket = Instance.new("Part") local Tool = script.Parent 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(23) Tool.RocketScript:clone().Parent = Rocket Tool.Explosion:clone().Parent = Rocket Tool.Swoosh:clone().Parent = Rocket function fire(vTarget) local vCharacter = Tool.Parent; local vHandle = Tool:findFirstChild("Handle") if vHandle == nil then print("Handle not found") return end local dir = vTarget - vHandle.Position dir = computeDirection(dir) local missile = Rocket:clone() local pos = vHandle.Position + (dir * 6) --missile.Position = pos missile.CFrame = CFrame.new(pos, pos + dir) 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.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 Tool.Enabled = true function onActivated() if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end local targetPos = humanoid.TargetPoint fire(targetPos) wait(0.5) Tool.Enabled = true end script.Parent.Activated:connect(onActivated) true