I cant see what ive done wrong with this script. Its meant to be a Can-Collide script for a TAS GUI im making for Flood Escape 2. Can Someone help me correct this?

    
     input.UserInputType == Enum.UserInputType.keyboard then
        
        if input.Keycode == Enum.Keycode.X then
            for _, child in ipairs(workspace.Map:GetDescendants()) do
            if child:IsA("BasePart") then
              child.Transparency = child.CanCollide and 0 or 1
              local shade = math.random() / 2 + 0.5
              if child:IsA("UnionOperation") then
                child.Color = Color3.new(shade, shade, 0)
              elseif child:IsA("MeshPart") then
                child.Color = Color3.new(0, shade, 0)
              else
                child.Color = Color3.new(shade, shade, shade)
              end
            end
        end
    end```

4 comments

0

Please format script first

0

Can you tell us what the problem is? We don't know what's wrong with the script.

0

What the output says?

0

Why did you put "child.Transparency = child.CanCollide and 0 or 1"