Firstly, I give credit to a user who supported me with this script, LetThereBeCode
Ok so there are 2 parts, both with cancollide false and the script within these parts disabled. I want the script to randomly choose one part and to turn both cancollide to true and the script within that part to disabled = false. I apologise for my poor explaining. Perhaps there is a simpler way to also disable the script?
local children = script.Parent:GetChildren() while wait(3.5) do local choosen = children[math.random(1,#children)] local solidity = choosen.CanCollide == false local prevDisable = choosen.Script.Disabled == true choosen.Script.Disabled = false choosen.CanCollide = true wait(3.5) choosen.Script.Disabled = prevDisable choosen.CanCollide = solidity end
Line 3 and 4
local solidity = choosen.CanCollide local prevDisable = choosen.Script
Line 9 and 10
prevDisable.Disabled = true solidity.CanCollide = false
Therefore,
local children = script.Parent:GetChildren() while wait(3.5) do local choosen = children[math.random(1,#children)] local solidity = choosen.CanCollide local prevDisable = choosen.Script choosen.Script.Disabled = false solidity = true wait(3.5) prevDisable.Disabled = true solidity = false end