• Help with LUA Error PLS! Assuming it's dead code but can't find replacement.
    3 replies, posted
I'm adding Elder Scrolls: Morrowind SWEPS but all of them have this error when you right-click (which is throwing, the weapon) [TES:Morrowind Tantos and Katanas Reuploaded] lua/entities/ent_mor_tanto/init.lua:61: attempt to call global 'ValidEntity' (a nil value)   1. unknown - lua/entities/ent_mor_tanto/init.lua:61 Line 60: local Ent = data.HitEntity Line 61:     if !(ValidEntity(Ent) or Ent:IsWorld()) then return end I'm assuming this is the function to check if it's hitting a player, npc or the world but it would seem that ValidEntity(Ent) is no longer a valid function. How can I fix this? PLS HELP!
IsValid should work. What error do you receive when you use it?
As listed in first post the error printout is as follows. [TES:Morrowind Tantos and Katanas Reuploaded] lua/entities/ent_mor_tanto/init.lua:61: attempt to call global 'ValidEntity' (a nil value) 1. unknown - lua/entities/ent_mor_tanto/init.lua:61 Line 60: local Ent = data.HitEntity Line 61: if !(ValidEntity(Ent) or Ent:IsWorld()) then return end I am currently trying Entity/IsValid as well to see if that will change the error printout but changes to the code have not yet changed the error print out.
change ValidEntity to IsValid
Sorry, you need to Log In to post a reply to this thread.