generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Clicking without clickdetector

Previous Thread :: Next Thread 
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
12 Mar 2016 05:13 PM
You know those games without any tools or anything and you just click stuff to interact with it, I want to make something like that where I can click stuff and it gets the player but I want to do it without click detectors and I want a GUI to show up on what I am hovering over, I know I am bad at explaining things but you know on like a survival game it says "Click to pick up"..Generic Item Name. I am not asking you to make the entire script even though that would be nice I just need some pointers and stuff. Thanks!
Report Abuse
SourHaze is not online. SourHaze
Joined: 15 Dec 2008
Total Posts: 588
12 Mar 2016 05:16 PM
The mouse has a "hit" property that refers to the object the mouse is hovering over. So just listen for the Button1Down event and find out what mouse.hit is.


Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
12 Mar 2016 05:23 PM
mouse.Move and mouse.Target
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
12 Mar 2016 05:28 PM
okie dokie thanks
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
12 Mar 2016 06:46 PM
but how would I make a gui pop up over the item which I am hovering over and follow the mouse while its over the object?
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
12 Mar 2016 07:19 PM
Change the position to Mouse.X, Mouse.Y if it's over an object.
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
12 Mar 2016 07:41 PM
alright, and if I wanted to make sure I am close to the object before i can interact will this work?
if (mouse.Target.Position).magnitude < Range then
Report Abuse
jode6543 is not online. jode6543
Joined: 16 Jun 2009
Total Posts: 5363
12 Mar 2016 07:51 PM
Try this snippet:
if (mouse.Target.Position - player.Character.Torso.Position).magnitude < Range then

If you only use magnitude on its own, it will give you the distance from the position (0,0,0), which probably isn't what you want.
Report Abuse
PraetorianTheGod is not online. PraetorianTheGod
Joined: 02 May 2014
Total Posts: 814
12 Mar 2016 08:01 PM
Alright thanks I got everything working but one thing is left, how can I tell that when the mouse is over a target that it clicks? This is the final piece, thanks a ton.
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Mar 2016 08:58 PM
button 1 down
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image