|
| 12 Jan 2016 05:52 PM |
local bandata = game:GetService("DataStoreService"):GetDataStore("BanData2") local list = script.Parent:WaitForChild("Main"):WaitForChild("list") list:ClearAllChildren() local gobj = script:WaitForChild("pers")
local horz = 3 local num = 0
while true do for i=1,999999999 do pcall(function() local dat = bandata:GetAsync(i) or {} local chances = dat.chances or 0 if chances > 3 then num = num + 1 local nobj = gobj:clone() nobj.Size = UDim2.new(1/horz, 0, 0, 40) nobj.Position = UDim2.new(1/horz * (num - (math.floor((num - 1) / horz) * horz) - 1), 0, 0, math.floor((num - 1) / horz) * 30) nobj.Parent = list end end) end wait(10) list:ClearAllChildren() end
I don't see a problem, someone help
There is no error, and before you say "omg its teh waitforchild", everything with the waitforchild part exists |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2016 05:54 PM |
| Maybe the if statement condition doesn't return true. |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2016 05:59 PM |
| i don't know how it could be, i have a different script that actually changes the "chances" value, and when it does "if chances > 3 then", it returns true |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 13 Jan 2016 03:46 PM |
"There is no error" There easily could be an error that you have suppressed by using pcall.
Remove pcall to see what the error is:
while true do for i=1,999999999 do local dat = bandata:GetAsync(i) or {} local chances = dat.chances or 0 if chances > 3 then num = num + 1 local nobj = gobj:clone() nobj.Size = UDim2.new(1/horz, 0, 0, 40) nobj.Position = UDim2.new(1/horz * (num - (math.floor((num - 1) / horz) * horz) - 1), 0, 0, math.floor((num - 1) / horz) * 30) nobj.Parent = list end end wait(10) list:ClearAllChildren() end
Or print the pcall:
while true do for i=1,999999999 do print(pcall(function() local dat = bandata:GetAsync(i) or {} local chances = dat.chances or 0 if chances > 3 then num = num + 1 local nobj = gobj:clone() nobj.Size = UDim2.new(1/horz, 0, 0, 40) nobj.Position = UDim2.new(1/horz * (num - (math.floor((num - 1) / horz) * horz) - 1), 0, 0, math.floor((num - 1) / horz) * 30) nobj.Parent = list end end)) end wait(10) list:ClearAllChildren() end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Jan 2016 03:50 PM |
a forloop with for 999999999 loops is going to crash the server and break your datastore limit on getasync
|
|
|
| Report Abuse |
|
|
|
| 13 Jan 2016 03:51 PM |
both ways did absolutely nothing
|
|
|
| Report Abuse |
|
|
|
| 13 Jan 2016 03:55 PM |
| Its getting data, not saving data |
|
|
| Report Abuse |
|
|