Azarias547 Posted April 3, 2016 Share Posted April 3, 2016 Every time I try to run my game it gives me an error saying "expected then near =" this is my program (I'm sure there's lots of other bugs). I'm still very new to lua, so I wouldn't be too surprised if it's something really simple. Script.Damage = 0 --int "Damage per interval" Script.Interval = 0 --int "Damage Interval" Script.Safety = false --bool "safe" function Script:Collision(entity, position, normal, speed) if(entity:GetKeyValue("Safe") == true) then self.saftey = true else self.safety = false end end function Script:UpdateWorld() if self.saftey == false if(DamTaken == true)then DamInt = Time:GetCurrent() + self.Interval end Now = Time:GetCurrent if DamInt < Now then NewHealth = (entity:GetKeyValue("health")) - self.Damage entity:SetKeyValue("health") = NewHealth end end end Quote Link to comment Share on other sites More sharing options...
Rick Posted April 5, 2016 Share Posted April 5, 2016 if self.saftey == false missing a then at the end 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.