Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can somebody tell me whats wrong with my code?

Asked by 10 years ago

Please help

local DL = script.Parent.sdsd

Game.Workspace.k.Teknikk.DoorSensorInn.Sensor.Touched:connect(function(p)
    if p~= nil then
        for L=1, #DL do
            DL[L].Transparency = "0.5"
            DL[L].CanCollide = true
        end
        wait(2)
        for L=1, #DL do
            DL[L].Transparency = "0"
            DL[L].CanCollide = false
        end
    end
end

2 answers

Log in to vote
0
Answered by
Mystdar 352 Moderation Voter
10 years ago

Here I rescripted your one, Put a part in the workspace called part.

local Door = script.Parent -- The part
function onTouch() -- When touched
    Door.CanCollide = False -- Walkthroughable
    Door.Transparency = 0.5 -- Transparent
    Door.BrickColor = BrickColor:Random() -- Changes colour (If you want, if not just remove this line and the other one)
    wait(2) -- waits 2 seconds
    Door.CanCollide = true -- Solid again
    Door.Transparency = 0 -- Opaque 
    Door.BrickColor = BrickColor:Random() -- Changes colour again (If not then remove this line too)
end
Door.Touched:connect(onTouch)
0
Thanks :D Prideful_Ryan 38 — 10y
0
No problem! Mystdar 352 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Please explain what is this, What is does In more detail otherwise we don't know!

0
When the sensor is touched by a humanoid it will make the part appear, then make it disappear after 2 seconds. Prideful_Ryan 38 — 10y
0
Ok vectorxray 5 — 10y

Answer this question