when i use self.entity:Release() the exe crashes when playing and use the health when i keep the player in idle anim its not crashing but when i move or rotate player with weapon the exe crashes, can someone say how to use it
i use it in Health pickup when enemy dead it pops out of the enemy a health box, tutorial was on youtube
i am new to lua i am a beginner here is the healthpickup script
Script.health = 15.0 --float "Health"
Script.useOnce = true --bool "Use once"
function Script:Start()
if self.health < 0 then
error("Health can't be a negative value.")
end
end
function Script:Use(player)
if player.script.health < player.script.maxHealth then
player.script:ReceiveHealth(self.health)
if self.useOnce then
self.entity:Release()
end
end
end