bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 02 Jan 2012 10:05 AM |
idk what forum this goes in but,
i have 6 waves, (6 models that look like waves) together, i have a script that makes them bodyvelocity move, through a terrain, its fine at first when its on top of a brick that i cframed so the terrain has an ocean, but, when the wave hits the terrain, the whole game laggs like more lag then i ever has had before, and i do not know why? any ideas why the game laggs like mad, there is only like 1000 bricks in the whole game ......... probibly less then that ..... |
|
|
| Report Abuse |
|
DXPower
|
  |
| Joined: 21 Oct 2008 |
| Total Posts: 2866 |
|
|
| 02 Jan 2012 10:09 AM |
Are you using a touched script in EVERY single brick on the wave?
If yes, don't do that, it will activate so many scripts that it will lag...
Try doing this:
function kill(hit) local h = hit.Parent:findFirstChild("Humanoid") if h~=nil then h.Health = 0 end end
while true do local p = script.Parent:GetChildren() for i = 1, #p do wait() p[i].Touched:connect(function(hit) kill(hit) end) end wait() end
|
|
|
| Report Abuse |
|
DXPower
|
  |
| Joined: 21 Oct 2008 |
| Total Posts: 2866 |
|
|
| 02 Jan 2012 10:10 AM |
| Put that in every wave model. It will only activate 1 script, not millions. |
|
|
| Report Abuse |
|