如果球员在同一支球队,他们可以碰撞,如果他们不是,他们就不能。同一支球队的球员也不能互相射击,因为如果他们在同一支球队,子弹不会与球员相撞(这是我想解决的问题)。
function GM:ShouldCollide( pl, ply ) -- teams can collide Friendly fire doesn't work bc bullets travel through
if IsValid(pl) and IsValid(ply) then
if pl:IsPlayer() and ply:IsPlayer() then
if pl:Team() == 1 and ply:Team() == 1 then --- guard
return false
end
if pl:Team() == 0 and ply:Team() == 0 then
return false
end
end
end
return true结束
发布于 2021-02-04 02:56:19
ply:设置冲突组(COLLISION_GROUP_WEAPON)
https://stackoverflow.com/questions/66032135
复制相似问题