bin = script.Parent Backpack = bin.Parent Me = Backpack.Parent PlayerGui = Me.PlayerGui Ki = PlayerGui.Bars.Ki Data = Me.Data
Activated = Me.Character.Occupied
local COOLDOWN = 0.5
r = game:service("RunService")
MAX_VELOCITY = 180 MIN_VELOCITY = 20
PULLBACK_TIME = 0
wait(0.1)
local Arrow = Instance.new("Part") Arrow.Locked = true Arrow.BackSurface = 0 Arrow.BottomSurface = 0 Arrow.FrontSurface = 0 Arrow.LeftSurface = 0 Arrow.RightSurface = 0 Arrow.Name = "Blast" Arrow.TopSurface = 0 Arrow.formFactor = "Symmetric" Arrow.Shape = "Ball" Arrow.Size = Vector3.new(2,2,2) if Data.Ki.Value == 1 then Arrow.BrickColor = BrickColor.new(23) elseif Data.Ki.Value == 2 then Arrow.BrickColor = BrickColor.new(21) elseif Data.Ki.Value == 3 then Arrow.BrickColor = BrickColor.new(1023) elseif Data.Ki.Value == 4 then Arrow.BrickColor = BrickColor.new(106) elseif Data.Ki.Value == 5 then Arrow.BrickColor = BrickColor.new(37) elseif Data.Ki.Value == 6 then Arrow.BrickColor = BrickColor.new(26) elseif Data.Ki.Value == 7 then Arrow.BrickColor = BrickColor.new(1) end Arrow.Transparency = 0.25 Arrow.Reflectance = 0.075 Arrow.CanCollide = false Arrow.Anchored = false Owner = Instance.new("ObjectValue") Owner.Parent = Arrow Owner.Name = "Owner" Owner.Value = Me script.Parent.ArrowScript:clone().Parent = Arrow
local force = Instance.new("BodyForce") force.force = Vector3.new(0,313,0) force.Parent = Arrow
function fire(target) if Ki.Value >= 50 and Activated.Value == false then
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 = Arrow:clone()
local spawnPos = game.Players.LocalPlayer.Character.PrimaryPart.Position
local pos = spawnPos + (dir * 5)
missile.CFrame = CFrame.new(pos, pos + dir)
missile.ArrowScript.Disabled = false
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = game.Players.LocalPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile
missile.Parent = game.Workspace
Chance = math.random(1, 3) if Chance == 1 then Data.KiControl.KiXP.Value = Data.KiControl.KiXP.Value+50 else Data.KiControl.KiXP.Value = Data.KiControl.KiXP.Value+15 end Ki.Value = Ki.Value - 50 end 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
local player = game.Players.LocalPlayer
if player == nil then return end
enabled = false
mouse.Icon = "http://www.roblox.com/asset/?id=41672909"
local pos = mouse.Hit.p
fire(pos, MAX_VELOCITY)
wait(COOLDOWN)
mouse.Icon = "http://www.roblox.com/asset/?id=11624732"
enabled = true
end
function onSelected(mouse) mouse.Icon = "http://www.roblox.com/asset/?id=11624732" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Selected:connect(onSelected)
arrow = script.Parent Owner = arrow.Owner damage = 3 position = arrow.Position
function fly() direction = arrow.CFrame.lookVector position = position + (direction*6) error = position - arrow.Position arrow.Velocity = error * 50 end
function onTouched(hit)
if hit.Parent.Name = Owner.Value.Name then
humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid=nil then
humanoid.Health = humanoid.Health - damage
end
explosion = game.Lighting.Bewm:clone()
explosion.Position = arrow.Position
explosion.Parent = workspace
wait(0.01)
arrow:Remove()
end
end
arrow.Touched:connect(onTouched)
t, s = r.Stepped:wait()
d = t + 7.0 - s
while t < d do fly() t = r.Stepped:wait() end
arrow:Remove()
