generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Items for StarterGear only loading for server *WTF*

Previous Thread :: Next Thread 
eRanged is not online. 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 is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
17 Apr 2016 10:49 AM
please help
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
17 Apr 2016 01:17 PM
bump



Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
17 Apr 2016 01:46 PM
hmmm



Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
17 Apr 2016 05:00 PM
f
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
17 Apr 2016 05:18 PM
re
Report Abuse
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
17 Apr 2016 05:30 PM
did you try remoteevents

idk sorry


-- 4 8 15 16 23 42
Report Abuse
LuaLlama is not online. 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
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
17 Apr 2016 05:41 PM
aye lmao


-- 4 8 15 16 23 42
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
17 Apr 2016 05:44 PM
ill give it a shot



Report Abuse
TimeTicks is not online. 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 is not online. 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
Developmant is not online. Developmant
Joined: 28 Feb 2013
Total Posts: 329
17 Apr 2016 05:47 PM
remote events ya


-- 4 8 15 16 23 42
Report Abuse
eRanged is not online. 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 is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
17 Apr 2016 05:55 PM
And yes it's a inventory



Report Abuse
TimeTicks is not online. 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 is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
17 Apr 2016 06:07 PM
aaaaaghh



Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Apr 2016 06:09 PM
does your game allow startergear?


Report Abuse
eRanged is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Apr 2016 06:21 PM
Try using starterpack


Report Abuse
eRanged is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image