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

Trying creating Clicker Attack Action?

I am facing terrible problem. Firstly, it will not allow me to rest in peace. Well, Robloxians, I am attempting to make my mouse click using the scripts.

I am not experienced, but have a lot of potential if you will support me. Thank you for whoever does.

player = game:GetService("Players"):FindFirstChild("LocalPlayer"):GetMouse()

-- for the mouse script

Any ideas how I can make this into a click script. Thanks!

2 comments

0

tsk tsk tsk

0

LocalPlayer isn't a child of the Players Server, but rather a property

1 answer

✓ Accepted answer

Make sure to put this into a local script in StarterGui or StarterCharacterScripts:

player = game.Players.LocalPlayer:GetMouse() --Gets the localplayer's mouse.

player.Button1Down:Connect(function() --Whenever the left mouse button gets pressed.
	--code here.
end)

Hope this helped!

3 comments

0

...lol why define the mouse as the "player"?

0

blame "SignedRobloxian". i try and keep the scripts as close to the original form as possible.

0

Perfectly done.

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