script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "RedRectangleVehicle" then
local children = hit.Parent:GetChildren()
children:Destroy
end
end)
I don't know why it isn't working. Please help. -rayhansatria
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "RedRectangleVehicle" then
local children = hit.Parent:GetChildren()
children:Destroy
end
end)
I don't know why it isn't working. Please help. -rayhansatria
You could either delete the whole model like this:
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "RedRectangleVehicle" then
hit.Parent:Destroy()
end
end)
Or you could try clearing its children like this:
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "RedRectangleVehicle" then
hit.Parent:ClearAllChildren()
end
end)
Try this..
function onTouch(hit)
if hit:IsA("Model") then
if hit.Name == "RedRectangleVehicle" then
hit.Parent:ClearAllChildren()
end
end
end
script.Parent.Touched:Connect(onTouch)
Try this and tell me if it worked!
You cannot touch models
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
Doesn't work, the vehicle just go through the block
can you post the explorer window
Oh, my children are just union, nevermind. Works! Thanks
please accept it as an answer if it works :)