Jump to content

noblebrad121

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by noblebrad121

  1. well its not spawning objects and for some odd reason the script:UpdateWorld() is not blue like it should be.

    but function is blue.

     

     

    Script.spawnObject = "" --entity "spawn object"

    Script.spawnTime= 1.0 --float "Spawn time"

    Script.timer = 0

     

    function Script:UpdateWorld()

    self.timer = self.timer + (Time:GetSpeed()/100)

    if(self.timer > self.spawnTime) then

    local newObject = self.spawnObject:Instance()

    newObject:SetPosition(self.entity:GetPosition ())

    self.timer = 0

    end

    end

     

    thank you for mentioning that its good to know.

  2. well that fixed the line 9 but now the line 3 error came up it says

     

    script error attempt to index global 'script' (a nil value)

    line 3

     

    i changed the script to this

     

    Script.spawnObject = "" --entity "spawn object"

    Script.spawnTime= 1.0 --float "Spawn time"

    script.timer = nil

     

    function Script:UpdateWorld()

    self.timer = self.timer + (Time:GetSpeed()/100)

    if(self.timer > self.spawnTime) then

    local newObject = self.spawnObject:Instance()

    newObject:SetPosition(self.entity:GetPosition ())

    script.timer = 0

    end

    end

     

    and it still did it after i changed the script.

     

    btw i am really new to programming and stuff i dont really have any experience

  3. Hello i am trying to create a spawner just a simple one and it seems to have a small error i dont understand. Any help would be greatly appreciated.

     

     

    here is my code

     

    Script.spawnObject = "" --entity "spawn object"

    Script.spawnTime= 1.0 --float "Spawn time"

    self.timer = 0

     

    function Script:UpdateWorld()

    self.timer = self.timer + (Time:GetSpeed()/100)

    if(self.timer > self.spawnTime) then

    local newObject = self.spawnObject:Instance()

    newObject:SetPosition(self.entity:GetPosition {)}

    self.timer = 0

    end

    end

     

    and the error i get says

     

    script error

    unexpected symbol near ')'

     

    line 9

     

    that is the only error that it has came up with.

     

    thank you for any help

×
×
  • Create New...