I tried this but it didn't work. Please help, thank you.

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")

local tool = script.Parent

local debounce = false

local throw = tool.Throw
local throwTrack = humanoid:LoadAnimation(throw)

local function throw()
	print("throw")
	local ball = tool.Handle --the part I want to throw
	ball.Velocity = ball.Cframe.LookVector * 20
end

tool.Activated:Connect(function()
	if not debounce then
		debounce = true
		
		throwTrack:Play()
		throw()		

		wait(1)
		debounce = false
	end
end)

2 comments

0

Do this on the server, not on the client.

0

Try using a RemoteEvent and firing a ServerScript from the LocalScript above.