local SpawnLocation = workspace:WaitForChild("SpawnLocation")
SpawnLocation.Touched:Connect(function(hit)
if hit.Name == ("SomePart") then
SpawnLocation.Enabled = false
print(SpawnLocation.Enabled)
end
end)
I changed it slightly and checked if a part touching the SpawnLocation was a specific part, it worked when testing.
This also works if the script is placed inside the SpawnLocation instance itself:
script.Parent.Touched:Connect(function(hit)
if hit.Name == ("SomePart") then
script.Parent.Enabled = false
print(script.Parent.Enabled)
end
end)