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: Distance?

Previous Thread :: Next Thread 
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Dec 2014 07:15 PM
--How would I add distance to this so you can click all the way across the map?

Player = game.Players.LocalPlayer

local mouse = Player:GetMouse()
function click()
local Item = mouse.Target
if Item.Name == "VehicleSeat" and Item~=nil then

Player.Character:MoveTo(Item.Position)

end
end
mouse.Button1Down:connect(click)
Report Abuse
fret13103 is not online. fret13103
Joined: 15 Mar 2010
Total Posts: 881
06 Dec 2014 07:16 PM
mouse.hit.Position(x,y,z) or something like that.
Report Abuse
everliving2000 is not online. everliving2000
Joined: 17 Jun 2009
Total Posts: 131
06 Dec 2014 07:18 PM
--How would I add distance to this so you can click all the way across the map?

Player = game.Players.LocalPlayer

local mouse = Player:GetMouse()
function click()
local Item = mouse.Hit
if Item.Name == "VehicleSeat" and Item~=nil then

Player.Character:MoveTo(Item.Position)

end
end
mouse.Button1Down:connect(click)
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Dec 2014 07:22 PM
Next in line please
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Dec 2014 07:24 PM
so you can't************
Report Abuse
fret13103 is not online. fret13103
Joined: 15 Mar 2010
Total Posts: 881
06 Dec 2014 07:25 PM
if Item.Name == "VehicleSeat" and Item~=nil then

I forgot mouse clicks have names.

Now I feel bad for the millions of mouse click's who's names I didn't credit for the making of my games.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
06 Dec 2014 07:26 PM
You should be using a ClickDetector for parts, which has a MaxDistance property, doesn't need to be in a local script (will run in the workspace) and passing an argument of the player who clicked it.
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Dec 2014 07:44 PM
This script is very important, someone help?
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
06 Dec 2014 07:46 PM
Have you tried using the other posts as guides or solutions?
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Dec 2014 07:47 PM
yes.. ClickDetector cannot be used in this situation. I need to have distance
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
06 Dec 2014 07:53 PM
If the mouse can't grab a target from that far away then there's nothing you can do. Why can't you use ClickDetectors anyway?
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