在我之前用GetEyeTrace怎么能知道一个实体。我想要检查这个,如果实体==武器,那么做任何事情...
如下所示:
if ply:GetEyeTrace().Entity.IsWeapon() then
print("+")
end但是IsWeapon()函数没有。
发布于 2020-06-17 21:41:23
应该是:IsWeapon()
您还应该检查实体是否有效。
local ent = ply:GetEyeTrace().Entity
if(!IsValid(ent)) then return end
if(ent:IsWeapon()) then
print("This is a weapon.")
endhttps://stackoverflow.com/questions/62410413
复制相似问题