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

How do i make it so when i click (not the gui just anywhere) the gui changes?

Asked by 3 years ago
Edited 3 years ago

title so im attempting to make a gun and for the gui to change to the recoil image when you click what are some options for doing this?

1 answer

Log in to vote
0
Answered by 3 years ago

You can use the players mouse like this

-- In a local script
local Player = game.Players.LocalPlayer

-- You can get the players mouse input like this
local Mouse = Player:GetMouse()

-- And to detect when the player clicked anywhere
Mouse.Button1Down:Connect(function()

    -- Put what you want to do when the player clicks in here

end)

And the Mouse has more Events, Values and stuff so if you want to check them out you can click on this link

0
hi, sorry for bothering you further im new to this, where do i put this script. oborlex 4 — 3y
0
you can put this script in the gun you were making NathanTheCraziest 105 — 3y
Ad

Answer this question