function getPlayer()local G=Tool.Parent return(game:GetService("\080\108\097\121\101\114\115")):GetPlayerFromCharacter(Character)end function Toss(G)local l=Vector3.new(Tool.Handle.Position.X,0,Tool.Handle.Position.Z)local E=Character.Head.Position E=E+G*5 local Y=Tool.Handle:Clone()Y.Burn.Attachment.Debris.Enabled=true Y.ThinkFast:Destroy()Y.Parent=workspace Y.Swing.Pitch=(Random.new()):NextInteger(90,110)/100 Y.Swing:Play()Y.CanCollide=true Y.CFrame=Tool.Handle.CFrame Y.Velocity=G*AttackVelocity+Vector3.new(0,AttackVelocity/7.5,0)Y.Trail.Enabled=true local B=11.25 Y.RotVelocity=Vector3.new((Random.new()):NextNumber(-B,B),(Random.new()):NextNumber(-B,B),(Random.new()):NextNumber(-B,B))Y:SetNetworkOwner(getPlayer())local p=DamageScript:Clone()p.Parent=Y p.Disabled=false local J=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")J.Value=getPlayer()J.Name="\099\114\101\097\116\111\114"J.Parent=Y end PowerRemote.OnServerEvent:Connect(function(G,l)local E=getPlayer()if E~=G then return end AttackVelocity=l end)TossRemote.OnServerEvent:Connect(function(G,l)local E=getPlayer()if E~=G then return end if Cooldown.Value==true then return end Cooldown.Value=true if Humanoid and Humanoid.RigType==Enum.HumanoidRigType.R15 then TossRemote:FireClient(getPlayer(),"\080\108\097\121\065\110\105\109\097\116\105\111\110","\065\110\105\109\097\116\105\111\110")end local Y=l.p local B=(Y-Character.Head.Position).unit local p=(Random.new()):NextInteger(1,10)if p==1 then local G=Tool.Handle.ThinkFast:Play()end Toss(B)task.wait(CooldownTime)Cooldown.Value=false end)Tool.Equipped:Connect(function()Character=Tool.Parent Humanoid=Character:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")end)Tool.Unequipped:Connect(function()Character=nil Humanoid=nil end)
--returns the wielding player of this tool
function getPlayer()
	local char = Tool.Parent
	return game:GetService("Players"):GetPlayerFromCharacter(Character)
end

function Toss(direction)
	local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
	local spawnPos = Character.Head.Position

	spawnPos = spawnPos + (direction * 5)

	local Object = Tool.Handle:Clone()
	Object.Burn.Attachment.Debris.Enabled = true
	Object.ThinkFast:Destroy()
	Object.Parent = workspace
	Object.Swing.Pitch = Random.new():NextInteger(90, 110) / 100
	Object.Swing:Play()
	Object.CanCollide = true
	Object.CFrame = Tool.Handle.CFrame
	Object.Velocity = (direction * AttackVelocity) + Vector3.new(0, AttackVelocity / 7.5, 0)
	Object.Trail.Enabled = true

	local rand = 11.25
	Object.RotVelocity = Vector3.new(
		Random.new():NextNumber(-rand, rand),
		Random.new():NextNumber(-rand, rand),
		Random.new():NextNumber(-rand, rand)
	)
	Object:SetNetworkOwner(getPlayer())

	local ScriptClone = DamageScript:Clone()
	ScriptClone.Parent = Object
	ScriptClone.Disabled = false

	local tag = Instance.new("ObjectValue")
	tag.Value = getPlayer()
	tag.Name = "creator"
	tag.Parent = Object
end

PowerRemote.OnServerEvent:Connect(function(player, Power)
	local holder = getPlayer()
	if holder ~= player then
		return
	end

	AttackVelocity = Power
end)

TossRemote.OnServerEvent:Connect(function(player, mousePosition)
	local holder = getPlayer()
	if holder ~= player then
		return
	end

	if Cooldown.Value == true then
		return
	end
	Cooldown.Value = true

	if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
		TossRemote:FireClient(getPlayer(), "PlayAnimation", "Animation")
	end
	local targetPos = mousePosition.p
	local lookAt = (targetPos - Character.Head.Position).unit

	local SecretRNG = Random.new():NextInteger(1, 10) --Change RNG value here
	if SecretRNG == 1 then
		local ChucklenutsSound = Tool.Handle.ThinkFast:Play()
	end

	Toss(lookAt)
	task.wait(CooldownTime)
	Cooldown.Value = false
end)

Tool.Equipped:Connect(function()
	Character = Tool.Parent
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)

Tool.Unequipped:Connect(function()
	Character = nil
	Humanoid = nil
end)
