#Hallo, help me make a door

1 messages · Page 1 of 1 (latest)

quartz skiff
#

Hi, i just started to learn programming in rbs. Im following a tutorial of a guy named BrawDev and tried making a door. For some reason it's not working so i decided to ask for help, perhaps i can get an answer on why its not functioning

The code is rather simple:
´´
local mainGame = game.Workspace:WaitForChild("MainGame")

local gates = mainGame:WaitForChild("Gates")
local buttons = mainGame:WaitForChild("Buttons")

local function openGate(button, touched)

touched.value = true

local gate = gates:FindFirstChild(button.name)

if gate then
    gate.Transparency = 0.5
    gate.CanCollide = false
end

local duration = buttons:FindFirstChild("Duration")

task.wait(duration.Value)

gate.Transparency = 0
gate.CanCollide = true

touched.value = false

end

for _, button in pairs(buttons:GetChildren()) do
button.Touched:Connect(function(otherPart)
local humanoid = otherPart.Parent:FindFirstChild("Humanoid")
local touched = button:FindFirstChild("Touched")

    if humanoid and touched and touched.Value == false then 
        openGate(button, touched)
    end
end)

end
´´
Despite that, while in the video everything went right for some reason mine didnt

quartz skiff
#

the gate would get translucent and the collision would be deactivated for 10 seconds

#

before returning back to normal

cursive storm
#

and nothing happends so far?

quartz skiff
#

the duration variable is a intValue in the gate

quartz skiff
cursive storm
#

is there any error

quartz skiff
#

No, nothing in there

cursive storm
#

u know where to look?

quartz skiff
#

yeah, nothing seems to be happening

#

its says something about line 33, but from what im seeing, its just the call to action

cursive storm
#

scroll up

quartz skiff
#

Oh

#

well i cant really find anything, but line 33 is a call for this function here

hot sleetBOT
#

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

cursive storm
#

and

#

show me what it says

quartz skiff
#

OH

#

in console

cursive storm
#

u should see red text directly above blue one

quartz skiff
#

Ahh now i found it

cursive storm
#

may i see

quartz skiff
#

here

#

well now thats emberassing

cursive storm
#

capital V

quartz skiff
#

Ok, imma change it

#

worked

#

Ty!

cursive storm
#

np

quartz skiff
#

was not expecting this, i guess coding takes a bit more of my attention. But ay, one step closer to making something