Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why wont this message print when I click?

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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)
0
It didnt work, does it have to be in a certain place because right now its in startercharacterscript. surviarlTheJefkillre 55 — 3y
0
I edited it, hope it works now :) deadwalker601 110 — 3y
0
If it worked please accept this anwser deadwalker601 110 — 3y
0
yeah it didnt work sorry surviarlTheJefkillre 55 — 3y
View all comments (4 more)
0
any arrors? deadwalker601 110 — 3y
0
if no errors put it in starter player scripts deadwalker601 110 — 3y
0
It worked! It was supposed to be a local script surviarlTheJefkillre 55 — 3y
0
when using game.player.localplaye rit has to be a local script deadwalker601 110 — 3y
Ad

Answer this question