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: Mini-map?

Previous Thread :: Next Thread 
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
22 Dec 2013 12:51 PM
No, not the script that makes things smaller. A mini-map is a map that displays something. Basically I want to know how to display enemies nearby on a GUI. How would I do that? I don't want a script, I want to know how to go about this, but if you give a little example code I would be happy.

"U BROKE THE TV U IDIOT!", "Hell hath no fury like a woman born." - CeaselessSoul
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
22 Dec 2013 12:57 PM
It's pretty complicated. You have to scale the Gui to the map, then use magnitude to compare the distance between you and the character. Then you scale that to a distance on the Gui.
Sorry, but I don't know how to explain it very well.

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
22 Dec 2013 12:59 PM
Would I get the relative position for the enemy (red dot) and the character (blue dot)?

"U BROKE THE TV U IDIOT!", "Hell hath no fury like a woman born." - CeaselessSoul
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
22 Dec 2013 01:00 PM
dist = (game.Workspace.YOU.Torso.Position - game.Workspace.ENEMY.Torso.Position).magnitude
Then scale dist to fit on the Gui.

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
22 Dec 2013 01:01 PM
local rangeGui = Radius

local pos = game.Players.LocalPlayer.Character:GetModelCFrame().p
Then just
for i,v in pairs(game.Players:GetPlayers()) do
if v.Character then
playerP = v.Character:GetModelCFrame().p
if (math.sqrt( (playerP.X-pos.X)^2+(playerP.Z - pos.Z)^2)< rangeOfGui then
icon.Position = UDim2.new(.5 - (playerP.X - pos.X)/rangeGui, 0,.5- ( playerP.Z-pos.Z)/rangeGui,0)
end
end
end

Dere.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
22 Dec 2013 01:04 PM
Should rangeOfGui be rangeGui? Also what should I change rangeGui to? The radius of what? Sorry, but I want to know this so I can decode it...

"U BROKE THE TV U IDIOT!", "Hell hath no fury like a woman born." - CeaselessSoul
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
22 Dec 2013 01:09 PM
rangeGui, yes

Radius being how far you want your radar to show, like show the noobs within 1000 studs or something.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
22 Dec 2013 01:10 PM
Thank you, you're awesome. Now to decode.

"U BROKE THE TV U IDIOT!", "Hell hath no fury like a woman born." - CeaselessSoul
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