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: Trying to make a rangefinder...

Previous Thread :: Next Thread 
Lord_Anhur is not online. Lord_Anhur
Joined: 27 Sep 2008
Total Posts: 561
13 Jun 2017 05:56 AM
So here's the code: local Player = game.Players.LocalPlayer local cam = workspace.CurrentCamera local Mouse = Player:GetMouse() while wait() do NewV = cam.CFrame.p ####### # ################################################### Dist = DistRay:Distance(Mouse.Hit.p) if Dist < 1000 then script.Parent.HUD.DistanceDisplay.Text = ""..("%.2f"):format(Dist).." Studs" else script.Parent.HUD.DistanceDisplay.Text = "1000+ Studs" end end Problem I'm having is that, instead of refreshing the point in where the camera is, I get the distance from the middle of the map. Is this me being a dolt? Any help would be appreciated, thanks! Also, if anyone can help in making the mouse less sensitive in First Person too, that'd be grand!
Report Abuse
Lord_Anhur is not online. Lord_Anhur
Joined: 27 Sep 2008
Total Posts: 561
13 Jun 2017 05:57 AM
...ROBLOX...Why... Dist ### # ### new(Vector3 new(NewV) ,Vector3 new(Mouse Hit p)) Unformatted for filter convenience.
Report Abuse
Lord_Anhur is not online. Lord_Anhur
Joined: 27 Sep 2008
Total Posts: 561
13 Jun 2017 05:58 AM
Ray equals Ray.

Is what that darn filter is blocking.
Report Abuse
Lord_Anhur is not online. Lord_Anhur
Joined: 27 Sep 2008
Total Posts: 561
13 Jun 2017 05:59 AM
local Player = game.Players.LocalPlayer
local cam = workspace.CurrentCamera
local Mouse = Player:GetMouse()

while wait() do
NewV = cam.CFrame.p
Dist Ray equals Ray new(Vector3 new(NewV),Vector3 new(Mouse Hit p))
Dist = DistRay:Distance(Mouse.Hit.p)
if Dist < 1000 then
script.Parent.HUD.DistanceDisplay.Text = ""..("%.2f"):format(Dist).." Studs"
else
script.Parent.HUD.DistanceDisplay.Text = "1000+ Studs"
end
end

Fixed version.
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