#How to search through module with a loop

37 messages · Page 1 of 1 (latest)

outer kernel
#

First question would be, why are you doing this on the client?

limber needle
#

because I want to load those stats on a UI afterwards

#

sorry for not saying that

outer kernel
limber needle
#

this is the error for it, I don't think handling it serverside and replicating it to client would help. Or did I missunderstood what you meant

outer kernel
limber needle
#

okay will try that

outer kernel
#

Now back to the error

#

Where do you define the module?

limber needle
#

I used

#

wait

#
local rs = game:GetService("ReplicatedStorage")
local folder = rs:WaitForChild("Modules")
local module = require(folder.Stats)
#

I'm trying to pass everything through remote event into server script where I execute the loop and then pass it through another remote event to client, but it does nothing

outer kernel
#

mmmm

#

one second i am a bit busy, will return to you

jovial knot
#

for k,v in state.Stats1 do
end
?

coarse matrix
#

looks right

limber needle
coarse matrix
#

its alr

limber needle
#

@jovial knot wdym by the "state"

jovial knot
#

Mb stat

limber needle
#

oh okay

#

Module Script

#

Local Script

#

(The module is named PestsStats I renamed it)

jovial knot
#

replace stats with your module name

limber needle
#

okay and if I were to add like 25 more how would I do it so it finds the right one and gets those stats, that was what I was aiming for

jovial knot
#

if k == "stat name"

limber needle
#

I meant like if I were to add Stats2, Stats3 and search for their Attack, Speed, HP etc. how would I replace the module.Stats1 with module.Stats2 with a script

jovial knot
#

Replace stats1 by stats2 etc

limber needle
#

okay thanks so much for help :)

jovial knot
#

Or do two loops

limber needle
#

wdym

jovial knot
#

for k,v in stats
for i,j in v do
if I == "stat name" then
end
end
End

coarse matrix
#

that is the most pointless thing ive seen

#

the for i, j is dumb cause it checks i which is just v