IDKBlox
|
  |
| Joined: 05 Apr 2013 |
| Total Posts: 1304 |
|
|
| 14 Feb 2015 03:36 AM |
| Callbacks cannot yield? please explain |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 14 Feb 2015 03:39 AM |
so have you ever seen hoodwinked
he got a callback
the axe man |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 14 Feb 2015 03:39 AM |
Script please
Are you using some kinda bindable or remote, event or function |
|
|
| Report Abuse |
|
|
drager980
|
  |
| Joined: 25 May 2009 |
| Total Posts: 13385 |
|
|
| 14 Feb 2015 03:40 AM |
| hoodwinked was a good movie |
|
|
| Report Abuse |
|
|
IDKBlox
|
  |
| Joined: 05 Apr 2013 |
| Total Posts: 1304 |
|
|
| 14 Feb 2015 03:43 AM |
128
for i,v in pairs (p.Extras:GetChildren()) do local connection = DataStore:OnUpdate(v.Name, function(value) print(v.Name.. " was changed to "..value) DataStore:SetAsync(v.Name, v.Value) end) if DataStore:GetAsync(v.Name,v.Value)~=nil then v.Value=DataStore:GetAsync(v.Name,v.Value) print(v.Name," ",DataStore:GetAsync(v.Name,v.Value)) end end |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2015 03:45 AM |
| pauls bunion cream has the soothing formula |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 14 Feb 2015 03:47 AM |
local connection = DataStore:OnUpdate(v.Name, function(value) print(v.Name.. " was changed to "..value) DataStore:SetAsync(v.Name, v.Value) end) onUpdate can not yeild (pause, wait) and SetAsync pauses shortly while saving I'm pretty sure thats it
I don't know if this will work but it should
local connection = DataStore:OnUpdate(v.Name, function(value) print(v.Name.. " was changed to "..value) spawn(function() DataStore:SetAsync(v.Name, v.Value) end) end) |
|
|
| Report Abuse |
|
|
IDKBlox
|
  |
| Joined: 05 Apr 2013 |
| Total Posts: 1304 |
|
|
| 14 Feb 2015 03:49 AM |
alright, one more question. When i try this
for i,v in pairs (p.Extras:GetChildren()) do v.Changed:connect(function(value) print(v.Name.. " was changed to "..value) DataStore:SetAsync(v.Name, v.Value) end) if DataStore:GetAsync(v.Name,v.Value)~=nil and DataStore:GetAsync(v.Name,v.Value)>=0 then v.Value=DataStore:GetAsync(v.Name,v.Value) print(v.Name," ",DataStore:GetAsync(v.Name,v.Value)) end end
i get this in the output after about 25 saves? anyone know why?
request limit exceeded on set |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 14 Feb 2015 03:52 AM |
| Remove any part that has to do with the data store (Comment out any Get and Set Async) and see how many times it prints |
|
|
| Report Abuse |
|
|
IDKBlox
|
  |
| Joined: 05 Apr 2013 |
| Total Posts: 1304 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 14 Feb 2015 03:55 AM |
| Because depending on how often those values change its gonna save, a lot |
|
|
| Report Abuse |
|
|
IDKBlox
|
  |
| Joined: 05 Apr 2013 |
| Total Posts: 1304 |
|
|
| 14 Feb 2015 04:04 AM |
| Thanks, i just decided to add a wait(30) and it seems to have work |
|
|
| Report Abuse |
|
|