tydog88
|
  |
| Joined: 27 Dec 2008 |
| Total Posts: 384 |
|
|
| 18 Jul 2011 07:00 AM |
Ok, just so you know, it's not so much that I don't know how to script as that I haven't scripted in this area before :-P
Current idea: Proximity I found a script in free models to work off of, but it looks really inefficient. Well here it is:
Distance = (Ship:GetModelSize()/2)
function ScanGame() Bricks = game.Workspace:GetChildren() for i=1,#Bricks do if Bricks[i]:IsA("Model") and Bricks[i]:findFirstChild("Humanoid") then if (Bricks[i].Torso.Position - script.Parent.Position).magnitude < Distance then --code end end end end |
|
|
| Report Abuse |
|
|
tydog88
|
  |
| Joined: 27 Dec 2008 |
| Total Posts: 384 |
|
| |
|
|
| 18 Jul 2011 07:48 AM |
Distance = (Ship:GetModelSize()/2)
function ScanGame() Player = game.Players:getPlayers() for i=1,#Player do if game.Workspace:findFirstChild(Player[i]) ~= nil then if (Player.Character.Torso.Position - script.Parent.Position).magnitude < Distance then --code end end end end
this way it doesn't scan every brick just the characters torso |
|
|
| Report Abuse |
|
|
tydog88
|
  |
| Joined: 27 Dec 2008 |
| Total Posts: 384 |
|
| |
|