I'm trying to make it so when somethings hit body position only affects the person hit
local function onTouched(hit) if hit.Parent ~= nil and hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent:FindFirstChild("Humanoid") ~= pchar.Humanoid and check == 0 then new.Transparency = 0.4 local qq = Instance.new("BodyPosition") qq.Position = new.Position qq.Parent = pchar["UpperTorso"] qq.MaxForce = Vector3.new(1e8,1e8,1e8) qq.P = 100 qq.D = 10 debris:AddItem(qq,5) end end
I tried this but it sucks up everyone that's anywhere near it
So after a while of messing around I finally figured out how to fix it (I also made the function more efficient)
local check = 0 hb.Touched:connect(function(hit) local ehum = hit.Parent:findFirstChild("UpperTorso") if hit.Parent ~= nil and hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent:FindFirstChild("Humanoid") ~= pchar.Humanoid and check == 0 then new.Transparency = 0.4 local qq = Instance.new("BodyPosition") qq.Position = new.Position qq.Parent = ehum qq.MaxForce = Vector3.new(1e8,1e8,1e8) qq.P = 100 qq.D = 10 debris:AddItem(qq,5) end end)
This works with R15 which is what "UpperTorso" is, if you're using r6 just do "Torso"