Basically what the title says i can't figure out how to do this. How would i make the part hurt others but not hurt me when i touch it, i tried this script but it doesn't work.
wait(5)
player = game.Players.LocalPlayer
mouse = player:GetMouse()
safe = game.Workspace.Player -- i used safe as the vairable to distingush between who gets hurt and who doesn't
print("GO")
detectionPad = Instance.new("Part",player.Character)
detectionPad.Anchored = true
detectionPad.CanCollide = false
detectionPad.BrickColor = BrickColor.new("Really blue")
detectionPad.Transparency = .4
detectionPad.FormFactor = Enum.FormFactor.Custom
detectionPad.Size = Vector3.new(10, 0.5, 10)
detectionPad.CFrame = detectionPad.CFrame*CFrame.Angles(1,0,0)
mesh = Instance.new("CylinderMesh",detectionPad)
while true do
wait()
detectionPad.CFrame = player.Character.Torso.CFrame
detectionPad.CFrame = detectionPad.CFrame *CFrame.new(0,-3.1,0)
if(player.Character.Torso.Position - detectionPad.Position).magnitude <= 5 then
if not safe then
print("Death") --not going adding the killing part yet
end
end
end

1 comment
bump