Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The function that gives the error (line that gives error is commented)
- function GameMode:HandleCollision(collider, collided)
- print("Testing bullet..")
- local collider_1, collider_2
- if collided.isBullet == true then
- collider_1 = collided
- collider_2 = collider
- end
- if collider.isBullet == true then
- collider_1 = collider
- collider_2 = collided
- end
- if not collider_1 then
- print("there is no bullet, returning")
- return
- end
- if collider_1.owningEntity.isBot == true and collider_2:IsRealHero() == true then
- print("collider_1 owning entity is a bot and collider_2 is a hero")
- collider_1:SuperhotDelete(collider_1)
- collider_2:SuperhotDelete(collider_2) -- !!! This is the line that gives the error
- end
- if collider_1.owningEntity:IsRealHero() == true and collider_2.owningEntity.isBot == true then
- print("collider_1 owning entity is a hero and collider_2 is a bot")
- collider_1:SuperhotDelete(collider_1)
- collider_2:SuperhotDelete(collider_2)
- end
- return false
- end
- -- Adding the function to the collider_2 in question
- hero.SuperHotDelete = function(hero)
- hero:ForceKill(false)
- hero:RespawnUnit()
- hero.item:RemoveSelf()
- GameMode:EndLevel(GameMode.CurrentLevel)
- GameMode:StartLevelForPlayer(GameMode.CurrentLevel, hero, true)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement