eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 17 Apr 2016 10:40 AM |
Server:
repeat wait() until #StarterGear:GetChildren() > 0 for _,v in pairs(StarterGear:GetChildren()) do if v:IsA("Tool") then Amount = Amount + 1 end end print(Amount) Remote:InvokeClient(p)
Local: Remote.OnClientInvoke = function() local Amount = 0 for _,v in pairs(StarterGear:GetChildren()) do if v:IsA("Tool") then Amount = Amount + 1 end end print(Amount)
For Non laggy places (Output):
1 1
For laggy places:
1 0
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
|
| 17 Apr 2016 05:30 PM |
did you try remoteevents
idk sorry
-- 4 8 15 16 23 42 |
|
|
| Report Abuse |
|
|
LuaLlama
|
  |
| Joined: 25 Jan 2014 |
| Total Posts: 1123 |
|
|
| 17 Apr 2016 05:38 PM |
Your siggy is from lost :3
figured it out
|
|
|
| Report Abuse |
|
|
|
| 17 Apr 2016 05:41 PM |
aye lmao
-- 4 8 15 16 23 42 |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Apr 2016 05:46 PM |
What are you exactly trying to do?
Is this an inventory?
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Apr 2016 05:46 PM |
And again, you are using stupid remote functions. I've told you 100000000000 times to use Remote events kid
|
|
|
| Report Abuse |
|
|
|
| 17 Apr 2016 05:47 PM |
remote events ya
-- 4 8 15 16 23 42 |
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 17 Apr 2016 05:54 PM |
Doesn't work with RemoteEvents either so chill xddd
Server:
local StarterGear = p:WaitForChild("StarterGear") local Remote = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Setup") repeat wait() until #StarterGear:GetChildren() > 0 for _,v in pairs(StarterGear:GetChildren()) do if v:IsA("Tool") then Amount = Amount + 1 end end print(Amount) Remote:FireClient(p) Local:
local Remote = game.ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("Setup") local AlreadyStarted = false
Remote.OnClientEvent:connect(function() if not AlreadyStarted then AlreadyStarted = true -- Testing Code Start -- local Amount = 0 for _,v in pairs(StarterGear:GetChildren()) do if v:IsA("Tool") then Amount = Amount + 1 print(v.Name) end end print(Amount) repeat wait() until #StarterGear:GetChildren() > 0
Output:
1 0
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Apr 2016 06:07 PM |
why are you doing
repeat wait() until #startergear> 0 ?
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Apr 2016 06:09 PM |
does your game allow startergear?
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 17 Apr 2016 06:10 PM |
Waiting until there's an item in the StarterGear, the reason why it's in the local part, is just to test. The weirdest part is it works in a non laggy place but a laggy place (for example "Roblox Sample [City] ") doesn't make it work. I removed all the scripts aswell. I also tried it in different laggy games. No difference.
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 17 Apr 2016 06:11 PM |
How do I check that? I didn't even know that was a option? It probably does considering in works a 1 player test server in studio (while LAGGY)
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 17 Apr 2016 06:15 PM |
"StarterGear is a container that is automatically inserted into each Player when the player joins the game. If a game allows gear, all of a player's appropriate gear will be inserted in to StarterGear when the player joins the game. Whenever the player's Character spawns, all of the contents of that player's StarterGear will get copied into the player's Backpack."
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 17 Apr 2016 06:18 PM |
Weird thing also, I have a ChildAdded script that doesn't work ingame also but it works for the DataStore, also once again it works in solo/non laggy place/ in 1 player test mode.
|
|
|
| Report Abuse |
|
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 17 Apr 2016 06:19 PM |
That' doesn't explain much though. The problem is, it works just not in laggy games.
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
eRanged
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 17 Apr 2016 06:25 PM |
I don't really want to use StarterPack, because when you equip/unequip a Item, it fires the ChildAdded/Remove function and i'll have to add all this extra to censor that and stuff i dont really feel like doing that xD. But I'll use it to Check if it prints 0 :)
|
|
|
| Report Abuse |
|
|