Holding mouse but returns false

Tried using touchpad on my laptop and it works fine as well. It is either a problem with his trackpad or with his laptop.

1 Like

I keep seeing this same question … So I’m going hard core this time!

local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local UserInputService=game:GetService("UserInputService")

local isButtonDown=false

local function checkMouseButtonDown(input)
    if input.UserInputType==Enum.UserInputType.MouseButton1 then
        isButtonDown=true
    end
end

local function checkMouseButtonUp(input)
    if input.UserInputType==Enum.UserInputType.MouseButton1 then
        isButtonDown=false
    end
end

UserInputService.InputBegan:Connect(checkMouseButtonDown)
UserInputService.InputEnded:Connect(checkMouseButtonUp)

function someFunction()
    if isButtonDown then

   --- this is the check function. do what you will here.
 
    end
end

Client script … btw

Pretty much the same script we sent him, it’s a problem with his device or trackpad.

Nah it works in the actual game just not in studio

Well that works for me in studio. Looking at it now I’m not sure why I went with local function …

can you show the server side script?

its probably your pc specs, what are they
if thats not the issue, maybe print??