zxo pink Posted June 23, 2016 Share Posted June 23, 2016 hi i have this code: if TotalMoney==nil then TotalMoney=0 end function Script:Start() if TotalMoney==nil then TotalMoney=0 end Totalmoney=Totalmoney+1 end function Script:Release() Totalmoney=Totalmoney-1 end function Script:UpdateWorld() self.entity:Turn(0,1.0*Time:GetSpeed(),0,true) end function Script:Collision(entity, position, normal, speed) if entity.script then if type(entity.script.CollectMoney)=="function" then entity.script:CollectMoney() if self.sound then self.sound:Play() end self.entity:Hide() end end end function Script:Detach() if self.sound~=nil then self.sound:Release() self.sound=nil end end and my error is: attempt to perform arithmetic on global 'Totalmoney' (a nil value) can somone please help me Quote Link to comment Share on other sites More sharing options...
Rick Posted June 23, 2016 Share Posted June 23, 2016 Lua is case sensitive so your adding with 'Totalmoney=Totalmoney+1' which has a lower case 'm' instead of an upper case like in your top part. 1 Quote 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.