CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Jan 2015 09:02 PM |
Bc i am doing a loop but it has a ton of stuff in it so i feel like shortening the wait can make it more smooth...
|
|
|
| Report Abuse |
|
|
| |
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Jan 2015 09:06 PM |
local Eyes = game.Workspace:FindFirstChild("Eyes"):GetChildren()
function findTorso(pos) local torso = nil local dist = 75 local child = workspace:children() for i=1, #child do if child[i].className == "Model" then local h = child[i]:findFirstChild("Humanoid") if h ~= nil then local check = child[i]:findFirstChild("Torso") if check ~= nil then if (check.Position - pos).magnitude < dist then torso = check dist = (check.Position - pos).magnitude end end end end end return torso end
while true do for i = 1,#Eyes do wait() local torso = findTorso(Eyes[i].Position) if torso ~= nil then Eyes[i].CFrame = CFrame.new(Eyes[i].Position, torso.Position) end end end
Lol what. I have a model in workspace witch is like 10 eyes so. Bang It works but it's pretty like slow. As in the eyes are moving laggy-like even though the server has 0 lag |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2015 09:08 PM |
yep ur doing it wrong u need to weld them |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Jan 2015 09:10 PM |
>tells me I am doing it wrong >doesn't tell me how to fix it |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2015 09:10 PM |
| Would you mind stating what exactly you are trying to accomplish. |
|
|
| Report Abuse |
|
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
|
| 04 Jan 2015 09:11 PM |
welcome to scripters 2015 always not at your service
|
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Jan 2015 09:13 PM |
I am trying to get a model (full of parts that have eye meshes) to simpley look at the player when they are within a certain range(or not it really doens't matter about the range but to reduce lag)
Ye |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Jan 2015 09:17 PM |
Oh and it's a singleplayer game so I don't actually need it to make it find the nearest torso. Instead i can just make it follow the single players torso which will speed it up a bit? |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2015 09:18 PM |
IN LOCAL SCRIPTS
render =game:service'RunService'.RenderStepped; render:wait();
IN SERVER SCRIPTS
heart =game:service'RunService'.Heartbeat; heart:wait(); |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Jan 2015 09:19 PM |
| Does that just capture when the player walsk ro something |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2015 09:21 PM |
KOTWarrior has some of the least beautiful code ive ever seen ever
|
|
|
| Report Abuse |
|
|
|
| 04 Jan 2015 09:21 PM |
| No, I was providing a faster wait. |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
| |
|
|
| 04 Jan 2015 09:21 PM |
but your code is UGLY!
not this in particular... |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jan 2015 09:22 PM |
| you're one of those guys who tries to compact Their Code as Much as Possible its UGLY!!!!! |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Jan 2015 09:24 PM |
@Chief Shhh Don't judge his way of scripting. It's an art. He can say your code to many character is ugly Gg
Lol It's still really slow. Is there like a better way of doing what i am trying or |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2015 09:24 PM |
even my USERNAMES are prettier than his...
KOTwarrior versus something SUPER COOL like Vulnerite or ChiefDelta or Procellus... |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2015 09:25 PM |
| u know vuln/proc are the same people right? |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jan 2015 09:26 PM |
| u know i am vuln/proc right |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 04 Jan 2015 09:27 PM |
HELP ME Take this fight to a different thread >.< |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 04 Jan 2015 09:27 PM |
| Heartbeat is 30fps like wait() D: |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2015 09:29 PM |
>says ur doing it wrong >tells u how to fix it
good guy bothangles :) |
|
|
| Report Abuse |
|
|