I'm working on a game, and in order to advance you have to find clues and such, which will probably be just different objects/model around the area. I don't want the game to be a "Search for the click mouse icon", but rather a game where you actually have to think and observe everthing around you.. I know there's a way to do this, but I cant find out how.
I'd appreciate either a YouTube video or a Wiki link. Example code would be nice, but it would also be nice to learn by myself via the wiki if possible.
You could use the Button1Down
event of the Mouse object, and then check the Target
property.
Code would look similar to this..
local plr = game.Players.LocalPlayer; local mouse = plr:GetMouse(); local whiteList = {"Clue1";"Clue2";"Clue3";"Clue4";"Clue5"}; mouse.Button1Down:Connect(function() local obj = mouse.Target; for _,v in next,whiteList do if v == obj.Name then print(v.." found!"); end end end)
You may also combine this with the Move
event for implementing a 'hovering' effect over objects.