Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
|
| 27 Dec 2015 06:11 PM |
Here's the only chunk of the script that you need to worry about:
events = game.ReplicatedStorage.WaitForChild("Events") players.PlayerAdded:connect(function() events.SetData:FireClient(p, itemTable, dst1:GetAsync(k)) end)
events.SetData.OnServerEvent:connect(function(p, name, value) print("Attempted to save "..p.Name.."'s data.") local k = p.userId local tab = dst1:GetAsync(k) tab[name][2] = value wait() print("Wait...") dst1:SetAsync(k, tab) print("AYY LMAO! Saved "..p.Name.."'s data.") end)
dst1 is dataStoreService:GetDataStore("TableData");The table is formatted like Table = {Thing1 = {"String", Bool}} in case you're wondering.
The client has absolutely NO problems. It can load and send data accordingly. But when SetData.OnServerEvent comes around, it only works like 25% of the time! I don't know what to do, I've been analyzing this for hours with no prevail. The table the client says is completely legit, the only, ONLY issue is when I get to "dst1:SetAsync(k, tab)"
WHENEVER I get here is where that 25% kicks in. I can fire as much as I want but only once or twice out of the like 10 times that i do it does the script actually get past this line... |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
|
| 27 Dec 2015 06:17 PM |
| more info here http://forum.roblox.com/Forum/ShowPost.aspx?PostID=180460625 |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
| |
|
|
| 27 Dec 2015 06:23 PM |
players.PlayerAdded:connect(function(p) events.SetData:FireClient(p, itemTable, dst1:GetAsync(k)) end)
The PlayerAdded event also gives you the player instance that was added. You need to pass it to the function that fires the event. I added 'p' to the arguments of the function. Try it now. |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
|
| 27 Dec 2015 06:28 PM |
oh sorry I left that out
it's in the script but when I was constructing the post I forgot it |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
| |
|
|
| 27 Dec 2015 06:41 PM |
Erm, I'm not going to help you fix a FM script.
"AYY LMAO" |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
|
| 27 Dec 2015 06:44 PM |
"Erm, I'm not going to help you fix a FM script."
so because I jokingly put 'AYY LMAO' in there it automatically makes the script a FM?
did you not read the rest of the post? I obv know what im talking about
you probably cant even script get out |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
| |
|
|
| 27 Dec 2015 06:53 PM |
| WaitForChild is a method. You should call it with ':' |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
|
| 27 Dec 2015 07:22 PM |
"WaitForChild is a method. You should call it with ':'"
why would that be the issue if it's always printing |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 27 Dec 2015 07:36 PM |
| you shouldnt call it with ":", you need to. |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
|
| 27 Dec 2015 07:54 PM |
| bump because hours after this thing is still bugged for no reason |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
| |
|
|
| 28 Dec 2015 07:30 PM |
| Lol, you just said I can't script? RIP you poor sole. Die the way the rest of the FM scripters do. |
|
|
| Report Abuse |
|
|
Barcado
|
  |
| Joined: 04 Oct 2014 |
| Total Posts: 1278 |
|
|
| 28 Dec 2015 09:42 PM |
quit being salty about how much your life sucks, no one cares
fixed the problem anyway, so you can put your ego away and gtfo |
|
|
| Report Abuse |
|
|
| |
|
| |
|