#how to make queue for a specific part for ai movements (first time using luau)

1 messages · Page 1 of 1 (latest)

nova dawn
#

im trying to make a queue for a specific part which animatronic AI will queue onto, since before they would double up. this is an extract of a function within a class which handles movements onto the parts:

        self.room = math.random(1,2)
        print(self.room)
        if self.room == 1 then
            print('movement start')
            task.wait(self.waittime)
            local S1P1queue = require(workspace.S1P1.S1P1queue)
            if S1P1queue == {} then
                print('move in progress')
                table.remove(workspace.currentroom, self.name)
                table.insert(workspace.S1P1.S1P1queue, self.name)                
                self.part:PivotTo(CFrame.new(S1P1.Position))
                self.stage=1
                print('move end')
            end

within my parts, i have a script that just makes a list, for example in workspace.S1P1 i have this

S1P1queue = {}

return S1P1queue

im getting an error that S1P1queue is not a valid member of Part "Workspace.S1P1".