@LucasTutoriaisSaimo
I’m trying to achieve something like this…
When the part named “Removed” touches “Bottom” then “Removed” becomes transparent and non-collidable.
This is exactly what I put to try to achieve this, it didn’t work.
function OnTouch(hit)
game.Workspace.Remove.Transparency = 1
game.Workspace.Remove.CanCollide = false
end
game.Workspace.Bottom.Touched:connect(OnTouch)
local removed =
local bottom =
Bottom.Touched:Connect(function(touched)
If touched == removed then
removed.Transparency = 1
removed.CanCollide = false
end
end)
edit: But then wouldnt removed fall into the void? Wouldnt you benefit a bit more from doing removed:Destroy()?
If you’re trying to check if the Part’s name is equal to what you wanna find, then…
function OnTouch(hit)
if hit.Name == "Bottom" then
game.Workspace.Remove.Transparency = 1
game.Workspace.Remove.CanCollide = false
end
end
game.Workspace.Bottom.Touched:connect(OnTouch)
--In ServerScriptService
local Bottom = workspace.Bottom
Bottom.Touched:Connect(function(touched)
if touched.Name == "Removed" then
touched:Remove()
end
end)
local Bottom = script.Parent -- Choose
Bottom.Touched:Connect(function(touched)
if string.lower(touched.Name) == string.lower("Removed") then
local Target = touched -- If you want a whole model to destroy then just change to where the model is, example: touched.Parent
Target:Remove()
end
end)