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

How to check if player clicked number 1 or 2 or 3? (without tools)

Asked by 4 years ago

I need start function when player clicked one of this numbers (1, 2, 3) you can use anything, mouse or UIS. Just this script should work.

And yes if you clicked 1 - 3 there's should be any print

2 answers

Log in to vote
1
Answered by
imKirda 4491 Moderation Voter Community Moderator
4 years ago

You can make LocalScript and put in into StarterPlayerScripts:

local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:Connect(function(key) key = key:lower() if key == "1" then print(game.Players.LocalPlayer.Name .. " pressed 1!") end end)

You can change key == "to any key you want to".

0
Use a code block JesseSong 3916 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

You can make LocalScript and put in into StarterPlayerScripts:

local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:Connect(function(key) key = key:lower() if key == "1" then print(game.Players.LocalPlayer.Name .. " pressed 1!") end end)

Answer this question