|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|