Tool=script.Parent Handle=Tool:WaitForChild("\072\097\110\100\108\101")Particles=Handle:WaitForChild("\080\097\114\116\105\099\108\101\115")Players=game:GetService("\080\108\097\121\101\114\115")Debris=game:GetService("\068\101\098\114\105\115")BaseUrl="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061"FireParticles=script:WaitForChild("\080\097\114\116\105\099\108\101\115")HitScript=script:WaitForChild("\072\105\116\083\099\114\105\112\116")Functions=require(script:WaitForChild("\070\117\110\099\116\105\111\110\115"))RbxUtility=LoadLibrary("\082\098\120\085\116\105\108\105\116\121")Create=RbxUtility.Create BasePart=(Create("\080\097\114\116"))({Shape=Enum.PartType.Block;Material=Enum.Material.Plastic;TopSurface=Enum.SurfaceType.Smooth,BottomSurface=Enum.SurfaceType.Smooth;FormFactor=Enum.FormFactor.Custom,Size=Vector3.new(.2,.2,.2);CanCollide=true,Locked=true,Anchored=false})Sounds={Fire=Handle:WaitForChild("\070\105\114\101")}Animations={Cast={Animation=Tool:WaitForChild("\067\097\115\116");FadeTime=nil;Weight=nil,Speed=3.5,Duration=.25}}Remotes=Tool:WaitForChild("\082\101\109\111\116\101\115")ServerControl=Remotes:FindFirstChild("\083\101\114\118\101\114\067\111\110\116\114\111\108")or(Create("\082\101\109\111\116\101\070\117\110\099\116\105\111\110"))({Name="\083\101\114\118\101\114\067\111\110\116\114\111\108",Parent=Remotes})ClientControl=Remotes:FindFirstChild("\067\108\105\101\110\116\067\111\110\116\114\111\108")or(Create("\082\101\109\111\116\101\070\117\110\099\116\105\111\110"))({Name="\067\108\105\101\110\116\067\111\110\116\114\111\108",Parent=Remotes})ReloadTime=1 ToolEquipped=false Handle.Transparency=0 Tool.Enabled=true function Activated()local S=InvokeClient("\077\111\117\115\101\068\097\116\097")if not S or not S.Position then return end if not Tool.Enabled or not CheckIfAlive()or not ToolEquipped then return end Tool.Enabled=false local a=true if ToolUnequipped then ToolUnequipped:disconnect()end ToolUnequipped=Tool.Unequipped:connect(function()a=false end)local j=Animations.Cast Spawn(function()InvokeClient("\080\108\097\121\065\110\105\109\097\116\105\111\110",j)end)wait(j.Duration/1)if ToolUnequipped then ToolUnequipped:disconnect()end if not ToolEquipped or not a then Tool.Enabled=true return end Sounds.Fire:Play()local u=BasePart:Clone()u.Name="\080\114\111\106\101\099\116\105\108\101"u.Transparency=.9 u.BrickColor=BrickColor.new("\068\101\101\112 \111\114\097\110\103\101")u.Material=Enum.Material.SmoothPlastic u.Shape=Enum.PartType.Ball u.Size=Vector3.new(2,2,2)u.CanCollide=false for S=1,10,1 do local a=FireParticles:Clone()a.LockedToPart=false a.Enabled=true a.Parent=u end local P={{Name="\067\114\101\097\116\111\114",Class="\079\098\106\101\099\116\086\097\108\117\101";Value=Player},{Name="\068\097\109\097\103\101",Class="\078\117\109\098\101\114\086\097\108\117\101";Value=math.random(25,45)}}for S,a in pairs(P)do local j=(Create(a.Class))({Name=a.Name,Value=a.Value;Parent=u})end local V=HitScript:Clone()V.Disabled=false V.Parent=u local C=S.Position local p=(CFrame.new(Handle.Position,C)).lookVector local U=196.2 local D=u:GetMass()*U local e=125 local b=p*e local Z=(Create("\066\111\100\121\086\101\108\111\099\105\116\121"))({Name="\066\111\100\121\086\101\108\111\099\105\116\121",maxForce=Vector3.new(D,D,D),velocity=b;Parent=u})u.Velocity=b u.CFrame=Handle.CFrame Debris:AddItem(u,5)u.Parent=game:GetService("\087\111\114\107\115\112\097\099\101")wait(ReloadTime)Tool.Enabled=true end function CheckIfAlive()return(Player and(Player.Parent and(Character and(Character.Parent and(Humanoid and(Humanoid.Parent and Humanoid.Health>0))))))and true or false end function Equipped()Character=Tool.Parent Player=Players:GetPlayerFromCharacter(Character)Humanoid=Character:FindFirstChild("\072\117\109\097\110\111\105\100")if not CheckIfAlive()then return end ToolEquipped=true end function Unequipped()ToolEquipped=false end function InvokeClient(S,a)local j=nil pcall(function()j=ClientControl:InvokeClient(Player,S,a)end)return j end function OnServerInvoke(S,a,j)if S~=Player or not ToolEquipped or not CheckIfAlive()or not a or not j then return end end ServerControl.OnServerInvoke=OnServerInvoke Tool.Activated:connect(Activated)Tool.Equipped:connect(Equipped)Tool.Unequipped:connect(Unequipped)


Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Particles = Handle:WaitForChild("Particles")

Players = game:GetService("Players")
Debris = game:GetService("Debris")

BaseUrl = "http://www.roblox.com/asset/?id="

FireParticles = script:WaitForChild("Particles")

HitScript = script:WaitForChild("HitScript")

Functions = require(script:WaitForChild("Functions"))

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

BasePart = Create("Part"){
	Shape = Enum.PartType.Block,
	Material = Enum.Material.Plastic,
	TopSurface = Enum.SurfaceType.Smooth,
	BottomSurface = Enum.SurfaceType.Smooth,
	FormFactor = Enum.FormFactor.Custom,
	Size = Vector3.new(0.2, 0.2, 0.2),
	CanCollide = true,
	Locked = true,
	Anchored = false,
}

Sounds = {
	Fire = Handle:WaitForChild("Fire")
}

Animations = {
	Cast = {Animation = Tool:WaitForChild("Cast"), FadeTime = nil, Weight = nil, Speed = 3.5, Duration = 0.25},
}

Remotes = Tool:WaitForChild("Remotes")
ServerControl = (Remotes:FindFirstChild("ServerControl") or Create("RemoteFunction"){
	Name = "ServerControl",
	Parent = Remotes,
})

ClientControl = (Remotes:FindFirstChild("ClientControl") or Create("RemoteFunction"){
	Name = "ClientControl",
	Parent = Remotes,
})

ReloadTime = 1

ToolEquipped = false

Handle.Transparency = 0
Tool.Enabled = true

function Activated()
	local MouseData = InvokeClient("MouseData")
	if not MouseData or not MouseData.Position then
		return
	end
	if not Tool.Enabled or not CheckIfAlive() or not ToolEquipped then
		return
	end
	Tool.Enabled = false
	local CurrentlyEquipped = true
	if ToolUnequipped then
		ToolUnequipped:disconnect()
	end
	ToolUnequipped = Tool.Unequipped:connect(function()
		CurrentlyEquipped = false
	end)
	local Animation = Animations.Cast
	Spawn(function()
		InvokeClient("PlayAnimation", Animation)
	end)
	wait(Animation.Duration / 1)
	if ToolUnequipped then
		ToolUnequipped:disconnect()
	end
	if not ToolEquipped or not CurrentlyEquipped then
		Tool.Enabled = true
		return
	end
	Sounds.Fire:Play()
	local Fireball = BasePart:Clone()
	Fireball.Name = "Projectile"
	Fireball.Transparency = 0.9
	Fireball.BrickColor = BrickColor.new("Deep orange")
	Fireball.Material = Enum.Material.SmoothPlastic
	Fireball.Shape = Enum.PartType.Ball
	Fireball.Size = Vector3.new(2, 2, 2)
	Fireball.CanCollide = false
	for i = 1, 10 do
		local Fire = FireParticles:Clone()
		Fire.LockedToPart = false
		Fire.Enabled = true
		Fire.Parent = Fireball
	end
	local Values = {
		{Name = "Creator", Class = "ObjectValue", Value = Player},
		{Name = "Damage", Class = "NumberValue", Value = math.random(25, 45)},
	}
	for i, v in pairs(Values) do
		local Value = Create(v.Class){
			Name = v.Name,
			Value = v.Value,
			Parent = Fireball,
		}
	end
	local HitScriptCopy = HitScript:Clone()
	HitScriptCopy.Disabled = false
	HitScriptCopy.Parent = Fireball
	local MousePos = MouseData.Position
	local Direction = CFrame.new(Handle.Position, MousePos).lookVector
	local Gravity = 196.20
	local Weight = (Fireball:GetMass() * Gravity)
	local Speed = 125
	local Velocity = (Direction * Speed)
	local BodyVelocity = Create("BodyVelocity"){
		Name = "BodyVelocity",
		maxForce = Vector3.new(Weight, Weight, Weight),
		velocity = Velocity,
		Parent = Fireball,
	}
	Fireball.Velocity = Velocity
	Fireball.CFrame = Handle.CFrame
	Debris:AddItem(Fireball, 5)
	Fireball.Parent = game:GetService("Workspace")
	wait(ReloadTime)
	Tool.Enabled = true
end

function CheckIfAlive()
	return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false)
end

function Equipped()
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	if not CheckIfAlive() then
		return
	end
	ToolEquipped = true
end

function Unequipped()
	ToolEquipped = false
end

function InvokeClient(Mode, Value)
	local ClientReturn = nil
	pcall(function()
		ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
	end)
	return ClientReturn
end

function OnServerInvoke(player, Mode, Value)
	if player ~= Player or not ToolEquipped or not CheckIfAlive() or not Mode or not Value then
		return
	end
end

ServerControl.OnServerInvoke = OnServerInvoke

Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
