#Script unable to detect object that exists
4237 messages · Page 5 of 5 (latest)
WHY WOULD YOU NEVER DO THAT?
WHAT IF YOU EDFIT
WHAT IF YOU EDIT YOUR STATS
ADD ANOTHER ONE
if i have to add a new one i need to edit the function anyway?!?
OR WHATEVER
THEN I NEED TO EDIT IT ANYWAY
WHAT
okay
with a for loop tell me how the HELL i can combine finesse and strength and weaponstats to equal your melee hitrate
with a for loop
or a repeat loop
tell me
and then explain how thats better than finesse.allcth+strength.allcth+mainhand.cth
i still need to add/multiple them
is
finesse = forido through datatable to find it
somehow better?
because to me thats MORE computing the script needs to do
instead of just giving it the direct table path
one) you will calc this outside the function
like, usually what you say makes some sense
at the start of the module
this time it makes
that way you dont have to do it every time its called
NO sense
but i need it to run every time the module is called?
if it isnt part of the function it wont use the current data
you dont need to get the variables every time
... yes i do though?
unless you mean
local a
function a()
a=1
end```
which, fine sure
still doesnt explain the forido or repeat loop you're suggesting
you iterate through the folders
and get all the values
then set them as needed
access their desired values via their names
what
oh
no, this is a table
not instances
the itemdatabase i have a modulescript that grabs the item from it's filepath/itemid and returns it
yes
why do you need this
what are you doing
what does it do
ok lets simplify this for you
you need to access all those values right
it grabs a combination of equipped items and your stats table to generate your character's statistics
yes
so i need access to them all
ok good
ok stop
more than once
no
NO
YES
corestats is just your "stats"
oh i typed those wrong
charstats
lets start wiuth that
define charStats as a variable
and replace data.charstats with that
why?
trust the process, we'll get somehwere
you're accessing it less times
more efficient
and code looks cleaner
other than "looks cleaner"
.
.-
is there a legitimate actual reason that makes sense
processing wise
does it then just check only charstats?
You're accessing it less times
i still fail to see why looping it even makes remote sense
:/
checks.. and checks.. and checks.. and checks..
imagine a file with less characters in it
less memory
aight bye
alright i've defined every required variable
you wont like it though
hm
talking about this lol
u dont wanna repeat the same thing over and over again
what if i stored the incoming data in a table? then just data[index] instead of a bunch of local variables?
anyway
datastats = data.charstats
core = core
strength = core.strength_Stat
agility = core.agility_Stat
endurance = core.endurance_Stat
intelligence = core.intelligence_Stat
wisdom = core.wisdom_Stat
presence = core.presence_Stat
finesse = core.finesse_Stat
level = datastats.levels
primarycls = level.primaryClass.Cls
primarylvl = level.primaryClass.Lvl
secondcls = level.secondClass.Cls
secondlvl = level.secondClass.Lvl
combocls = level.comboClass.Cls
combolvl = level.comboClass.Lvl
skill = datastats.skills
tankrole = skill.roles.tank.Lvl
atkrrole = skill.roles.atkr.Lvl
healrole = skill.roles.heal.Lvl
onehandlvl = skill.weaponSkills.oneHand.Lvl
twohandlvl = skill.weaponSkills.twoHand.Lvl
throwlvl = skill.weaponSkills.throw.Lvl
rangedlvl = skill.weaponSkills.ranged.Lvl
hiddenlvl = skill.weaponSkills.hidden.Lvl
magiclvl = skill.weaponSkills.magic.Lvl
shieldlvl = skill.weaponSkills.shield.Lvl
gear = datastats.equipped
head = gear.head
if head.itemTier ~= -1 then
headID = DatabaseSearch.itemSearch(head.itemID)
end
body = gear.body
if body.itemTier ~= -1 then
bodyID = DatabaseSearch.itemSearch(body.itemID)
end
hand = gear.hand
if hand.itemTier ~= -1 then
handID = DatabaseSearch.itemSearch(hand.itemID)
end
foot = gear.foot
if foot.itemTier ~= -1 then
footID = DatabaseSearch.itemSearch(foot.itemID)
end
neck = gear.neck
if neck.itemTier ~= -1 then
neckID = DatabaseSearch.itemSearch(neck.itemID)
end
ring1 = gear.ring1
if ring1.itemTier ~= -1 then
ring1ID = DatabaseSearch.itemSearch(ring1.itemID)
end
ring2 = gear.ring2
if ring2.itemTier ~= -1 then
ring2ID = DatabaseSearch.itemSearch(ring2.itemID)
end
mainhand = gear.mainhand
if mainhand.itemTier ~= -1 then
mainhandID = DatabaseSearch.itemSearch(mainhand.itemID)
end
offhand = gear.offhand
if offhand.itemTier ~= -1 then
offhandID = DatabaseSearch.itemSearch(offhand.itemID)
end```
theyre indented by their parent file
what the
i fail to see why there is any "horror" or anything bad really
its all the needed variables
defined
and sorted by where they come from
i use -1 to represent that it has nothing there
because i use 0 in some instances
?
no i check if the slot is empty
if it has -1 then its empty
otherwise it has an item in it
but u said ~= isnt that 'not equal to'
understand
that you
having to even do this
means that your system is inherently flawed
you NEED to do this?
you cant loop through them and check?
okay
tell me how you would loop it
gear is a dictionary right
youre very objective about this when the only way i can even think of making it work with a forido is so extra
yes, i can make each variable an index in an array
and set them like that
okay
now tell me why that even makes sense to bother doing when this works as is perfectly fine
to have that loop i then need an array for each thing to set them to
thats
MORE effort
than just setting them manually
although i will make the locals into an array
that DOES make sense
or a dictionary rather
local gears = datastats.equipped
for key, gear in gears do
if gear.itemTier == -1 then return end
ids[key.."ID"] = DatabaseSearch.itemSearch(gear.itemID)
end
simple
adaptable
what is "gears"
key is the name
but also why its completely unnessessary
arguing with an s2
there is a MASSIVE difference between "useful" and "clean"
its way easier and more daptable
IT IS USEFUL
IT IS VERY USEFUL
is nil
okay
then this adapts to it
THEN I NEED TO EDIT THE FUNCTION ANYWAY
which is why
you
make it
adaptable
so you DONT have to edit it
what happened to NTTS