|
| 03 Apr 2015 09:14 PM |
Workspace.Script:5: attempt to get length of global 'maps' (a nil value) is the output when I run this:
local disasters = game.ServerStorage:GetChildren()
----------------------------------------- while true do choseDisaster = disasters[math.random(1, #maps)] disasterClone = choseDisaster.Clone disasterClone.Parent = Workspace wait(180) disasterClone:remove() wait(15) end
|
|
|
| Report Abuse |
|
|
|
| 03 Apr 2015 09:15 PM |
| You didn't define "maps". Did you mean to put "disasters"? |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
| |
|
|
| 03 Apr 2015 09:16 PM |
the variable maps doesn't point to a table value.
Have you...
local Storage = game:GetService("ServerStorage")
local maps = { Storage.Map1, Storage.Map2 }
or
local maps = Storage.Maps:GetChildren() |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2015 09:21 PM |
I changed map to disasters now get the error attempt to index global 'disasterClone' (a function value)
Sorry, I'm new to scripting and just learning the basicz |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2015 09:36 PM |
It is a function. You need to call it. Since it is a method (Part of an object) call it with a colon.
Something:Clone() |
|
|
| Report Abuse |
|
|