Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

onButton1Down won't fire in tool?

I'm trying to make a (relatively) simple fully-automatic gun. I won't post the entire code, but this is where something's going wrong:

function onEquipped(mouse)
	print("Check 1") --This works
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

gun.Equipped:connect(onEquipped)

...And above that I have the onButton1Down function...

function onButton1Down(mouse)
	print("Check 2") --This doesn't work
	--...more code
end

6 comments

0

It is in a local script?

0

Nope. It's a server script.

0

Put it in a local

0

You're thinking of hopperbins. This is an actual tool.

0

Yeah, but the mouse is local

0

I do the test and its working and a test server ;)

1 answer

✓ Accepted answer

Here your error its you only didnt put your code in a local script, you can't got the mouse in a server script because the mouse is local. For more information on the mouse you can go one wiki here

This discussion is preserved as it was. New answers, comments, and votes are closed.