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

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

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

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

2 comments

0

hi, sorry for bothering you further im new to this, where do i put this script.

0

you can put this script in the gun you were making

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