• Checking if entity is prop then run code
    5 replies, posted
I figured this would be simple but so far I'm just doing a crap load of !target:IsPlayer() && !target:IsNPC() && etc... I only want my function to run if the entity is a prop..
if target:GetClass() == 'prop_physics' then ComplieString("Entity("..target:EntIndex().."):Remove()") end dat's it?
Haha thank you so much I knew it was going to be something simple! It's all working now
oh dear lord please dont do that that is so terrible if IsValid(target) and target:GetClass() == "prop_physics" then target:Remove() end seriously you have to have severe brain damage to think that compilestring shit is fine
I'd recommend using if IsValid(target) and (string.find(target:GetClass(), "prop_physics*") or string.find(target:GetClass(), "prop_dynamic*") then target:Remove() end Because source has multiple entities, and variants of them, for props.
Thank you for all of your input.
Sorry, you need to Log In to post a reply to this thread.