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 » Scripting Helpers
Home Search
 

Re: Distance error

Previous Thread :: Next Thread 
HilariousDwarf is not online. HilariousDwarf
Joined: 20 Aug 2010
Total Posts: 2020
04 Oct 2010 01:38 PM
local dist = 10

function onButton1Down(mouse)
local targ = mouse.Target
if targ~=nil then
if (targ.Position - mouse).magnitude < dist then
restofscriptbelow

________________________________________________________________________
Players.Player.Backpack.MineTool.Script:19: bad argument #2 to '?' (Vector3 expected, got userdata)

Players.Player.Backpack.MineTool.Script, line 19 - global onButton1Down Players.Player.Backpack.MineTool.Script, line 127 stack end

Disconnected event because of exception
Report Abuse
HilariousDwarf is not online. HilariousDwarf
Joined: 20 Aug 2010
Total Posts: 2020
04 Oct 2010 01:39 PM
Trying to make the max disance away from a part that you can use the tool at.
Report Abuse
HilariousDwarf is not online. HilariousDwarf
Joined: 20 Aug 2010
Total Posts: 2020
04 Oct 2010 02:41 PM
Bump
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
04 Oct 2010 02:56 PM
local dist = 10

function onButton1Down(mouse)
local targ = mouse.Target
if targ~=nil then
if (targ.Position - mouse.Position).magnitude < dist then


-- Im not pretty sure about it, i never use Guis o_e
Report Abuse
HilariousDwarf is not online. HilariousDwarf
Joined: 20 Aug 2010
Total Posts: 2020
04 Oct 2010 03:05 PM
Bump
Report Abuse
HilariousDwarf is not online. HilariousDwarf
Joined: 20 Aug 2010
Total Posts: 2020
04 Oct 2010 03:15 PM
(not a gui, its hopperbin)
Report Abuse
HilariousDwarf is not online. HilariousDwarf
Joined: 20 Aug 2010
Total Posts: 2020
04 Oct 2010 03:18 PM
Theres no position in mouse
Report Abuse
crazypotato4 is not online. crazypotato4
Joined: 22 Feb 2010
Total Posts: 20000
04 Oct 2010 03:20 PM
function onButton1Down(mouse)
local targ = mouse.Target
if targ~=nil then
if (targ.Position - script.Parent.Parent.Parent.Character.Torso.Position).magnitude < dist then
Report Abuse
HilariousDwarf is not online. HilariousDwarf
Joined: 20 Aug 2010
Total Posts: 2020
04 Oct 2010 03:22 PM
Omg thanks crazypotato! :D
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
04 Oct 2010 03:23 PM
mouse.CFrame.p

Thats how you get the vector3 of the mouse. It's not what you want, though. :P
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
04 Oct 2010 03:24 PM
Errr...

mouse.Origin.p


Universe["Milky Way Galaxy"]["Earth Satellite"].Roblox[Com].Forums.Floodcheck:Remove()
Report Abuse
RenderSettings is not online. RenderSettings
Joined: 16 Aug 2010
Total Posts: 2560
04 Oct 2010 03:36 PM
Still wrong. mouse.Hit.p returns a vector,since mouse.Hit is a CFrame
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
04 Oct 2010 03:37 PM
@Render

mouse.Origin is the CFrame, too. durp.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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