Ad
Log in to vote
0

I cant see what ive done wrong with this toggle collision script?

Asked by 5 days ago
Edited 5 days ago

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?

```local UserInputService = game:GetService("UserInputService")

 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```
0
Please format script first Sabailuridze 126 — 5d
0
Can you tell us what the problem is? We don't know what's wrong with the script. Nckripted 580 — 5d
0
What the output says? Gigaset39 41 — 5d
0
Why did you put "child.Transparency = child.CanCollide and 0 or 1" DAMOLA345 0 — 5d

Answer this question