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: Please help with my stupidness

Previous Thread :: Next Thread 
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
08 Apr 2016 02:11 PM
Perhaps Flux was right, I am an idiot :P
So the following code is meant to loop through a folder's children (Which is more folders). Here is the hierarchy: https://gyazo.com/95131e6e432b2ee140c968f8c49ea943

Here is what it, frustratingly, prints:
yeeep
GamepassData
WalkspeedAdd5 is not a valid member of Folder

No idea why

local AdditionalWalkspeed = Library.FindGamepassBonus(GamepassData.Walkspeed, Player)


function Library.FindGamepassBonus(Location, Player)
local add = 0
print'yeeeep'
print(Location.Parent.Name)
print(Location["WalkspeedAdd5"].Addition.Value)
for x,y in pairs(Location:GetChildren())do
print'sfdsdsdsdsfdsfdsfds'
print(y.Name)
print(y.Addition.Value)
print(add)
if Service:PlayerOwnsAsset(Player, y.ProductId.Value) then
if y.Addition.Value > add then
add = y.Addition.Value
end
end
end
print'2'
Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
08 Apr 2016 02:16 PM
Location:WaitForChild("WalkspeedAdd5")
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
08 Apr 2016 02:19 PM
Naw, doesn't work :(
Report Abuse
LuaLlama is not online. LuaLlama
Joined: 25 Jan 2014
Total Posts: 1123
08 Apr 2016 02:28 PM
:/ PM flux personally.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
08 Apr 2016 02:35 PM
Location is Walkspeed, not WalkspeedAdd5

for x,y in pairs(Location["WalkspeedAdd5"]:GetChildren())do

Not sure if it will work, but this is my go at it.
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
08 Apr 2016 03:59 PM
Location is Walkspeed, WalkspeedAdd5 is a child. [""] is how you get a child when it doesn't have a normal variable name, although the [""] is left over from a different name, so I could probably get rid of that
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
08 Apr 2016 05:44 PM
bbbb
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
08 Apr 2016 05:46 PM
"Perhaps Flux was right, I am an idiot"

You just realized this? Lol this thread is laughable.


Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
08 Apr 2016 05:57 PM
Just to rub it in a bit more, I don't suppose you could provide the solution. Because, this is really irritating me. It should be easy!
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
08 Apr 2016 06:56 PM
b
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
08 Apr 2016 06:58 PM
IQ of 142, you got this m8.
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
09 Apr 2016 06:38 AM
Oh, ffs. This is ridiculous. I must of put location as the wrong place, but I can't see what it should be instead
Report Abuse
Cuyler is not online. Cuyler
Joined: 27 Feb 2006
Total Posts: 3784
09 Apr 2016 06:49 AM
Your code worked fine for me when I had it like this:

local Library = {}
local Player = nil
local GamepassData = game:GetService('ReplicatedStorage'):WaitForChild('GamepassData')
local Service = game:GetService('MarketplaceService')


function Library.FindGamepassBonus(Location, Player)
local add = 0
print'yeeeep'
print(Location.Parent.Name)
print(Location["WalkspeedAdd5"].Addition.Value)
for x,y in pairs(Location:GetChildren())do
print'sfdsdsdsdsfdsfdsfds'
print(y.Name)
print(y.Addition.Value)
print(add)
if Service:PlayerOwnsAsset(Player, y.ProductId.Value) then
if y.Addition.Value > add then
add = y.Addition.Value
end
end
end
print'2'
end

local AdditionalWalkspeed = Library.FindGamepassBonus(GamepassData.Walkspeed, Player)

With the hierarchy being this:
https://gyazo.com/a021e23575810f67335de2a4963b7e51

Output:
https://gyazo.com/8e5af974a575681955cff89ac4d2882d


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