User Input Service not reading

I’m trying to make a throwing system where you equip a ball tool, hold your mouse, and let it go to shoot the ball. When I use the tool, it fires an event that activates a server-side script that has an rng system to decide which ball to use because there are different variations of the ball. When the system decides, it calls a module respective to the ball it chose. User input service inside the module does not read whether my mouse is down or not while I have the mouse held down.

local rs = game:GetService("ReplicatedStorage")
local debris = game:GetService("Debris")
local tweenS = game:GetService("TweenService")
local uis = game:GetService("UserInputService")

local function greenball(player)
	local char = player.Character
	local ball = rs.Balls.greenball:Clone()
	local size = ball.Size
	ball.Parent = game.Workspace
	size =,0.1,0.1)
	ball.CanCollide = false

	local ballTweenInfo =, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out, 0, false, 0)
	local newSize =,5,5)
	local tween = tweenS:Create(ball, ballTweenInfo, {Size =,3,3)})


	local arm = player.Character:FindFirstChild("Right Arm")
	local weld ="Weld")
	weld.Parent = ball
	weld.Part0 = arm
	weld.Part1 = ball
	ball.CFrame =  arm.CFrame *,-2.5,0)
	weld.C0 =,-2.5,0)
	uis.InputBegan:Connect(function(input, GameProcessedEvent)
		while uis:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do

return greenball

This is the module for one of the ball variants. It spawns the ball into my hand, but UIS isn’t detecting that my mouse is down.

1 Like

Inputended wouldnt be used for this as this detects the end of the input, you would likely want inputbegan

1 Like

It uses inputBegan now. I was experimenting with it and forgot to change it back for this post.

1 Like