Slastraf Posted October 10, 2015 Share Posted October 10, 2015 ... if Map:Load(mapfile)==false then return end zombiesleft= 0 zombieskilled = 0 roundssurvived = 0 zombiesextrahealth = 0 ... this is in the main.lua script function Script:NewRound() roundssurvived= roundssurvived +1 local a = (roundssurvived*.1) + roundssurvived self.maxEnemies= self.maxEnemies + Math:Round(a) end this is in an script attached to a pivot in the scene. The title is misleading in parts, i havent tried local variables yet but it would be nosense. "...: 41 : attempt to perform arithmetic on field 'currentround' (a nil value)" I get this error, am very confused since the calculation below this line that I implemented today worked. Quote Link to comment Share on other sites More sharing options...
Josh Posted October 10, 2015 Share Posted October 10, 2015 The script start() functions get called inside the Map::Load() function, so your variables have not bee declared yet at that time. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.