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

Why wont this message print when I click?

Earlier I asked a question about a script i was making and the person who answered helped me come up with this:

local Mouse = game.Players.LocalPlayer:GetMouse()
	 
Mouse.MouseButton1Down:Connect(function()
	    print("IT WORKED")
end

It didn't print, could it be a problem with what type of script it is or where i put the script? or am i just off by a long shot with my script?

1 answer

✓ Accepted answer

Cause you're using the wrong MouseButton1Down! Make sure its a LocalScript and this will work :)

local Mouse = game.Players.LocalPlayer:GetMouse()

Mouse.Button1Down:Connect(function()
	print("Click")
end)

8 comments

0

It didnt work, does it have to be in a certain place because right now its in startercharacterscript.

0

I edited it, hope it works now :)

0

If it worked please accept this anwser

0

yeah it didnt work sorry

0

any arrors?

0

if no errors put it in starter player scripts

0

It worked! It was supposed to be a local script

0

when using game.player.localplaye rit has to be a local script

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