I've been trying to disable a value based on another value for a certain amount of time. Came up with this, my 3rd version of it. Any better ways I can recreate this or at least make this version work?
while true do
repeat wait() until CC.CurrentTrackNumber.Value==22
script.Parent.Value.Value = true
wait(5)
OpenGates()
wait(15)
CloseGates()
wait(5)
script.Parent.Value.Value = false
end
CC=game.Workspace.CoasterCFrameV4Beta
--Ignore functions \/
function OpenGates()
local gateopenparts=CC.OpenGates:GetChildren()
local gateclosedparts=CC.ClosedGates:GetChildren()
for i=1,#gateopenparts do
gateclosedparts[i].Transparency=1
gateclosedparts[i].CanCollide=false
gateopenparts[i].Transparency=0
gateopenparts[i].CanCollide=true
end
end
function CloseGates()
local gateopenparts=CC.OpenGates:GetChildren()
local gateclosedparts=CC.ClosedGates:GetChildren()
for i=1,#gateopenparts do
gateclosedparts[i].Transparency=0
gateclosedparts[i].CanCollide=true
gateopenparts[i].Transparency=1
gateopenparts[i].CanCollide=false
end
end

1 comment
Thanks, looks like I need to study a bit more.