Im making a part that destroy all that touch, but only destroy players characters
ServerScriptService(need to be in ServerScriptService)
local DVP = workspace:FindFirstChild("DVP")
function DVPF()
if not DVP then
wait(10)
local DVP = workspace:WaitForChild("DVP") or workspace:FindFirstChild("DVP")
DVPF()
end
end
DVPF()
DVP.Touched:Connect(function(hit)
hit:Destroy()
end)
Firstly you don’t need all that code searching for DVP, you can just use workspace:WaitForChild("DVP")
Secondly, you can scan to see if what has touched a part is a character:
local DVP = workspace:WaitForChild("DVP")
DVP.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid") -- Search for Humanoid
if Humanoid and Humanoid:IsA("Humanoid") then -- If Humanoid exists and is a Humanoid
hit.Parent:Destroy() -- Destroy the Character
end
end)
If this is the case, .Touched() does not fire when interacting with other anchored parts as Physics are not applied. Can you send a screen recording of what exactly the incorrect behavior is?
i want to destroy all that touch, but dont destory anything without character i tried change the anchor/cancollide, more but the part didnt destroy, i only need a part that destroy everything that touch.
ok, so its possible to make that part destroy the baseplate when touch?
or i need to see the position of the baseplate and when the part touch this position the baseplate has destroy?
.Touched() only fires on new touches, since these two parts are already in contact when you start your game, they are already considered to be touching, and .Touched() does not fire.