Perfect Posted April 20, 2015 Share Posted April 20, 2015 (edited) Hello Everyone, after a long time. I just found my old script somewhere deep inside my computer. I am trying to modify it such that it can create as many peds as i want. but the problem is when i run it, my game almost froze and there are no errors/warnings debugscript. Script: --Table Pos = { {-1375.30627, -234.72827, 14.14844}, {-1375.30627, -234.72827, 14.14844}, {-1375.30627, -234.72827, 14.14844}, {-1375.30627, -234.72827, 14.14844}, ... } ... --Event addEventHandler("onClientRender", root, function() ... for i=...,... do local _i = i*(math.pi/180) for Ri=1,10 do --This thing is maybe calling on every frame, How to fix it ? local myPed = createPed(23,Pos[Ri][1],Pos[Ri][2],Pos[Ri][3]) setPedCameraRotation(myPed, ....+Pos[Ri][1], ...+Pos[Ri][2],Pos[Ri][1], Pos[Ri][2])) end end end) Can someone please help me ? Edited April 21, 2015 by Guest Link to comment
ALw7sH Posted April 20, 2015 Share Posted April 20, 2015 What's that for i=...,... do Link to comment
koeno100 Posted April 20, 2015 Share Posted April 20, 2015 Just as ALw7sH asked, you need a starting point (i=1) and an ending point, so for example: for i=1, 10 do. This will execute the loop 10 times. In your case, you have an infinite loop and it will never stop executing. Link to comment
Perfect Posted April 20, 2015 Author Share Posted April 20, 2015 That is code(function,variable, whatever you call it) in my script which i think is not necessary so i just replace it with '...' instead. ----------Edit---------- The problem is solved. Just have to put 'myPed' before the render event. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now