#Mystery doors not working

1 messages · Page 1 of 1 (latest)

shrewd sandal
#

so basically my mystery doors are not working idk why the problem is they dont kill you can touch them and collide but they dont kill

#

thats the script for em:
local Workspace = game:GetService("Workspace")

local Local = {}
local Shared = {}

function Shared.OnStart()
math.randomseed(time() * tick())
Local.SetupMysteryDoors()
end

function Local.SetupMysteryDoors()
for _, descendant in Workspace:GetDescendants() do
local isDoorModel = descendant.Name == "Door" and descendant:IsA("Model")
if not isDoorModel then continue end

    local killDoor = math.random(1, 2)
    local doorsFounds = 0
    for _, child in descendant:GetChildren() do
        local isDoorPart = child.Name == "Door" and child:IsA("Part")
        if not isDoorPart then continue end
                    
        doorsFounds += 1
        child.CanCollide = doorsFounds == killDoor
        if doorsFounds == killDoor then
            child:SetAttribute("Damage", 999)
        end
    end
end

end

return Shared

exotic sundial
#

Hold on im looknig at the text

#

dont do :GetService("Workspace")

#

do

#

if its localscript do game:WaitForChild("Workspace")
if its a normal script, do workspace

shrewd sandal
#

its modulescript

exotic sundial
#

OHH

wanton ingot
shrewd sandal
#

so what do i do to fix it

lethal estuaryBOT
#

studio** You are now Level 1! **studio

shrewd sandal
#

😮

shrewd sandal
#

dm you

shrewd sandal
exotic sundial
#

nop

#

i have never used module scripts in my life

shrewd sandal
#

oh alr

#

@wanton ingot

wanton ingot
waxen kite
#

whats thr gameplay design here?

#

randomize each door everytime the plr dies

#

?

wanton ingot
waxen kite
#

oh