#Script unable to detect object that exists
1 messages · Page 4 of 1
im guessing yes
thats if the compiler defines them in order
which i dont know if it does
you have to test that
AND if you can access them
yes
ok
more than likely you cant do that
itemFile = itemDataBase[itemType][itemTier][itemID]
itemColor = itemFile:GetAttribute("Color")
its for auto-complete
that way it feeds back a result
entirely different purposes
that there was an issue
.
if it doesnt do that wont there be a problem
like, if somehow it tries to fire the function with a non-player thing
what happens
i make it not fire a function with a non-player thing
whereas the classname thing i can make it print that it went wrong
again, they're for different purposes
i also do that
this is for intellisense, and i can see what type that attribute requires
but
the official lua website explains it better than i can
A fast, small, safe, gradually typed embeddable scripting language derived from Lua
what
at the start of the module script
along the script
shouldnt it be after all the functions before the return?
local thisModule = {}
local function thisModule.Foo()
end
--is the same as doing
thisModule["Foo"] = function()
end
return thisModule
all you're doing is setting a key in a dictionary
heck, you can even do
local thisModule = {}
thisModule[workspace.Part] = function()
end
return thisModule
cuz dictionaries support instance keys too lol
huh
okay
so
two things
one
how do i reference the different tables in default data again
two
can pleaaaase have a copy of the client script to handle data? 
specify the path and iterate depth
ClientDataReceiver (StarterPlayerScripts)
-- Services --
local ReplicatedStorage = game:FindService("ReplicatedStorage")
local ClientDataModule = require(ReplicatedStorage.ClientModules.ClientDataModule)
-- Variables --
local sendDataEvent = ReplicatedStorage.Remotes.SendData
local updateDataEvent = ReplicatedStorage.Remotes.UpdateData
-- Logic --
sendDataEvent.OnClientEvent:Connect(ClientDataModule.ReceiveData)
updateDataEvent.OnClientEvent:Connect(ClientDataModule.UpdateValue)
ClientDataModule (ReplicatedStorage.ClientModules)
local ReplicatedStorage = game:FindService("ReplicatedStorage")
local Signal = require(ReplicatedStorage.ClientModules.FastSignal)
local ClientDataModule = {}
local data = {}
local updateSignals = {}
function ClientDataModule.ReceiveData(playerData : {})
data = playerData
end
function ClientDataModule.UpdateValue(value : any, ... : string | number)
local currentTable = data
local pathTable = {...}
for index, key in pathTable do
if not currentTable[key] then
warn("Invalid path", pathTable)
return
end
if index < #pathTable then
currentTable = currentTable[key]
else
currentTable[key] = value
end
end
end
function ClientDataModule.GetValue(... : string | number)
local value
local currentTable = data
local pathTable = {...}
for index, key in pathTable do
if not currentTable[key] then
warn("Invalid path", pathTable)
return
end
if index < #pathTable then
currentTable = currentTable[key]
else
value = currentTable[key]
end
end
return value
end
return ClientDataModule
why accessing default data?
what does this mean
playerData, "tableIWant", "wHATEVER"
just to copy the multiple tables when you load a new character
somewhere you're doing
local x = y, z -- z is left unused
ohhhh
i forgot at one point i did a replace all
lol
what is "ClientModules"
a folder
"@End" "@FirstAvailable" "@Find"
yes
i uh
dont see the error...
you probably added another } right before a comma by accident
so its ending CoreStats and beggining a new table
format it
it should easily show itself like that
OR put your text cursor before the first bracket and it'll show you where it ends
like so
can you send it
found it?
lmao
that'd be best
or just
return nil
if theres gonna be nothing there when it creates it it will return empty anyways
no i mean if later i want to add something
then you :SetValue()
aight
im adding tags too so thats easier
so you can add stuff at the top of the stack or at the first available index
i'll see if i can add a "find" tag, to replace a value
nah, i have the name table seperate for SPECIFICALLY the purpose of not having to replace indexes
im talking about replacing a value
why red
say i want to replace "0" with "1"
but i dont know what index it is stored at
i find the first index containing 0
this too
alright come on
hover your mouse over it
its self explanatory at this point
okay, i figured both out
one was a local i forgot to set
one was i renamed a local to my style
because if i say local you know its a local variable
i call global variables globals
yet it doesnt need to be
if you say "i forgot to set a local" im thinking about variables which specifically need to be local
(also, saying global is common, but saying "local" isnt, so usually you say "local variable")
?
you dont just
local DEFAULT_DATA = require(script.DefaultData) ?
so you still have it defined
if you wanna learn from the lua website
read that
its also explained
here
is this an unreliableremoteevent?
custom signal module
its so i dont spam bindable events cuz theyre not great
- i can pass connections and
its just, better.
Hi! This is FastSignal. It’s an alternative to GoodSignal, with type checking, documentation, etc, it takes a slightly different approach to things than GoodSignal. This is not the same FastSignal advertised by stravant’s post! While being the same name, don’t let it fool you, it doesn’t sacrifice everything for performance. It prefers to be e...
do i need to instance anything?
yknow what
i dont even use that module
iots just a residue from when i was scripting
too unreliable?
for what?
No, i use it a lot
the fastsignal
(twas a joke)
oh
its just a signal library so i can add signals to my own classes
ahh
or connect other stuff directly without using bindale events
very safely
better than remote events
yknow how part.Touched is an event
with that module i can create one of those events
nothing in that scriped will break, right?
huh. neat
yeah it doesnt use it
i forgor to remove it
it runs the functions yeah
is there any benefit to that
instead of just having the module's code be in that script?
the module also has a :GetValue() function (thats the whole point of it)
so other local scripts can get values from the player's data
ohh
okay
so
why not just stick that in that playerscript and have it detect the getvalue requests?
are modules inherently faster?
or is the latency a non-issue
what'd be the point
if i had to get+
If the player data was stored in the script then i'd need a medium to request it
LocalScript -{requests data}> ModuleScript -{requests data}> DataScript -{sends data}> ModuleScript -{sends data}> LocalScript
or
LocalScript -{requests data}> BindableFunction -{invokes function}> DataScript -{returns data}> Bindable Function -{returns data}> LocalScript
but if i had it so the data is stored in the module then:
LocalScript -{requests data}> ModuleScript -{returns data}> LocalScript
?
one is requiring a module
the other is waiting for a child
no
or is there some advantage to one over the other?
require returns what the module contains
waitforchild returns the instance module itself
yes, if you want to get what the module returns
gotcha
if you need to wait for them, yes.
i always use wfc now
shouldnt*
its removed the need for taskwaits
if i havent referenced it's parent already*
*if you know something exists just access it directly
or if the script is a child of it
ye
sorry, i meant i use them for my starting variables
if you dont know IF something exists then :FindFirstChild
or if i need to wait for a clone of something to be in its new parent
you can also wait for events
this makes sense, right?
no
that way i can always know if its remote or not
not even a little
and it keeps them away from other things
so, it makes SOME sense?
just not total sense?
wait but why are you storing bindables in replicatedstorage?
which environment uses them?
client currently
then call it ClientSide
and have a seperate one for serverside?
oh those will-ye
"otherside" isnt clear
its like you're saying "other side compared to x"
yes, i get that, but a clearer name would be "crossBoundary"
yes but you're taking it as a physical space
aka word play
like
its fine
but its not fine
okay so, thats irrelevant in the grander scheme of things
if i saw "otherside" without knowing what the contents were, i would not know what it meant
i dont need that distinction personally because i dont use bindables ;)
should for inventory i just index forido through the table until i find an itemstack of -1?
i want to keep it all numbers always numbers
so if it becomes nil via error i can catch the error
wasting memory with value definitions & key names
i have a reason this time though other than personal preference!
no one does that
if nil warn"error at"..table.."."..table.slot..""
thats why im adding a @find tag
to my system
so i can say
okay, but without that
DataModule:SetValue(player, 0, "Inventory", "@find", -1)
DataModule:SetValue(player, 0, "Inventory", "@find_if[self_quantity]", -1)
then yes
you'd have to iterate through everything
the client stats/inventory/etc
from... where you need it?
if my gui needs the player's data then i require the module and use :GetValue() as needed
okay
** You are now Level 13! **
so... hm
so, how would i do that for the server inventory manager script?
just
datamodule:getvalue(inputs)?
well yea
get it, and set it
as needed
treat it as a simple container
note that the way i handle data is just one way of doing it
some people use OOP to make "profiles" of players and access data that way
whats remotes
i figured it was a remote event
back
ah okay
wait
so
why not use one remote and just give it an "envelope" like i did, and use a different function based on the envelope?
i only need to use the first one once
the "sendData" one
its simpler that way
if i did that id have to process 1 more thing every update
it adds up
ye
cuz my database will only string and number indices
no yeah when would it be a number?
stats_attacks_4
:SetValue(player, "Punch", Attacks, 4)
the limit bits are too confusing ;-;
not sure why attacks would be in stats, but pretty much yes
limit bits???
do you mean the type checking?
ye
i'll just ifnil them out
i feel like it explains them very well
again, those are for a different purpose
visually confusing*
i typecheck AND assert them
(assert = ifnil)
im struggling enough with modulescripts
i dont need more to learn right now
im still working on making inventory work
so wait
should i make a new modulescript that checks for the first openslot in the inventory?
otherwise i think i need to forido and refenence the module EACH TIME from the serverscript
i avoid that via a tag system (i thought you'd like that)
how does the tag system work?
i have a function which processses the tag into an index
every time the inventory updates it gets the lowest index of the array not filled and marks it?
wouldnt that just... be foridoing at a different time?
yes, but i avoid the hassle of doing it from the script that requires it
ye
so
same idea, basically?
if you do it beforehand, youre still "foridoing" it
just at a different time
well yea

its just this
so im not doing a silly wierd thing again
or just
if i dont understand it i cant add the overfill bag feature
LET ME LEARN ONE THING AT A TIME
if #currentTable == 50 then return nil end

understand what 😭
im just showing you the function
pleh
not the tags
do you need self?
you didnt read what i sent lol
yes
you usually do this for OOP
but sometimes i just do it on modules because it looks like a service :]
right?
[slot]
the slot in your inventory
right?
then print a bunch of vars as slot's data, send it back?
whatr
unless returning currentslot will give me all of the data in it
:getdata and specify "inventory_page_slot"
i want inventory to be seperate because i'll reference it A LOT
any quest with requirements
especially the add and remove commands
i want to be their own functions
anyway
whatever you say ig
will returning currentslot return all of its data?
yes
okay
youre testing while you do all this right?
yesnt
ok im not one to talk
i practically made my whole entity system without really testing it
but im not using it anywhere yet so it doesnt matter
lol
i cant test it rn
yeah fair
i need to convert EVERYTHING to using the database system first
honestly i just add commands in a random script to test stuff
same
when you forget to add something to your table:
(character name)
OH GOD I NEED TO ADD ENTRIES FOR CHARACTER LOOK

yeap
thats easy if you do it right
hairID = 5
etc
thats the easiest thing, cuz you have like a bajillion values for stats
no
oh and i ended up making stat names a seperate moduletable btw. MUCH easier
shame.
i think that i need a filter which censors your naming conventions
also cool
but see. i know they hold ONLY a table

it DOES exist for a reason
what is it called
i think you want type checking
:/
i guess you're gonna like it
when you get to it
why i name things wierdly:
i can excuse those
avoding using lua globals
thats why i use "Attributes" and not "Stats"
but those are rare exceptions
not really something you should base your naming conventions around
either way
aGuy is objectively the wrong name for a player
it doesnt tell you what the variable is.
plain and simple
how do you "send all data"?
okay
wait
cant i just set these
up here?
or is this just your way of organizing confusing me?
i define all services & modules first
then constants
then variables
then functions
then logic (aka the loose stuff)
its just my way of organizing things, but most scripters always define the services first
-- Services --
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local dataPing = ReplicatedStorage.pingables.otherside:WaitForChild("eventDataTransfer")
local dataVasily = ReplicatedStorage.pingables.otherside:WaitForChild("eventDataInital")
local ClientDataModule = require(ReplicatedStorage.ClientModules.ClientDataHandler_exe)
-- Logic --
dataVasily.OnClientEvent:Connect(ClientDataModule.ReceiveData)
dataPing.OnClientEvent:Connect(ClientDataModule.UpdateValue)

do you get the reference?
yeah see the comments suggest that dataPing & dataVasily are services
when they're not
no
red october
(cause it only pings once, when a player joins; and never again)

im old
ignore my naming conventions
this is in login handler
it is firing the bindable function to the datamodule thing in character scripts
to grab the data
when it grabs the data it will return true
...
will this work?
am back
retry system?
i believe the script will yield infinitely if it never returns something
also youre not passing the data btw
not yet
the loginhandler will ping the client data manager, which will ping the data handler which uses the datamodule to get the data and send it back to the client data manage, which will then reping the loginhandler to give the okay to continue logging in
hm#
should i just stick the login script in clientdatamanager?
hm
nah
maybe?
its currently in the logingui
StarterPlayerScripts sounds good to me
load data, equip body, equip saved gear, load saved inventory, load quest data, teleport to saved position
well thats an understandable name, at least.
even if i only impliment a single character slot per player
it still does enough on login that it needs a login screen
you mean a loading screen lol
it also means i can divert new players to a character menu using the login
cuz you'll also need that
it's both
just call it "loading screen" cuz getting data is a way of loading
oh yeah btw about places
every non-starter place will just have a loading screen
you'll probably want the same data module script in all places right?
only the "hopping off" one will use a login
i discovered a feature recently
of roblox
"packages"
it allows you to upload anything and you're able to use it anywhere
and when you edit it, all copies will be edited
extremely
keep in mind you have to press "update package" to apply changes to other copies
better than opening every place and manually doing it...
definitely
and they're private
so you dont have to worry about people peeking into your code
so
when the loginscript pings dataVasily
it will invoke the server, then send the invokation to the clientdatamodule
right?
am
well
yes but
you're not returning anything
what is "thatGuy"
the localplayer
did you send it twice?
you should remember that by now
:InvokeServer(player) it doesnt pass that to the client
what is torpedo
and more importantly
what the fuck is "dataKonolov"
like "thatGuy" made some kind of twisted far off sense
here, no idea.
konolov is the sub that sank red october
vasily pinged
konolov detected it
sent a torpedo

i must send pretty gifs
to prevent myself from
destroying the universe rn
at this moment
ok thats enough
back to iot
its an old movie and an older book series i get it
no excuse at this point
but it makes sense if you get the vasily reference
pov: someone has to help you and has to understand your code
and the variable names are: "artificer_spear_craft" and "halitus"
of course the first one means the process of attack data because spears are like attacks and the artificer turns spears into weapons
of course halitus means the jojo stand "Catch The Rainbow" because halitus means vapor which condenses into water which creates rain which is what the stand uses
thats how it feels
thats even more vague than my classic movie references
BECAUSE YOU UNDERSTAND THEM
i cant even google your variable names
WHICH ONE HUH
WHICH VASILY
OR IS IT ONE OF THESE?
i spelled it wrong mb
IT ISNT EVEN IN WIKIPEDIA???
😭
can you get more obscure than that?
references are fun and all but what would we do if function() was machine()
now im just confused
i give up with those names
youre gonna have to clarify all names when you ask me something
or well
anyway
ask anyone really
its a classic movie scene
who would think of that?
i dont even know that movie
i dont think i have any friends who know that movie
or friends of friends
tragedy
anyway
does the client data stuff need to know the localplayer or will it always know that because its perclient
right?
you can always access the local player from a local script or module
game.Players.LocalPlayer
well
it works
(i havent routed it to the module yet)
run rpgDataModule.RegisterPlayer?
right?
somehow, i broke it

yet whenever that is there it breaks
and i have no idea why
;-;
i think this is crashing the data handler
;-;
i dont think it will let me have the tables in a seperate module
because they
"arent a function"
which
is dumb
but apparently thats whats happening i guess?
nope
no idea
wait
i have no idea
i put them in functions and everything ;-;
"""functions"""
local STAT_NAMES={}
function STAT_NAMES.statNames()
local statnames={
CoreStats={
strength={
strength_Name="Strength",
meleeDamage_Name="Melee Damage",
throwDamage_Name="Throw Damage",
physCritD_Name="Physical CritD",
rush_gain_Name="Rush Gain",
meleeCtH_Name="Melee CtH"
},
agility={
agilityStat_Name="Agility",
meleeDodge_Name="Melee Dodge",
rangeDodge_Agi_Name="Ranged Dodge from Agility",
rangeDamage_Name="Ranged Damage",
staminaRegen="Stamina Regen",
rangeCtH="Ranged CtH"
},
endurance={
endurance_Name="Endurance",
physDef_Name="Physical Defence",
health_Name="Max Vitality",
rush_max_Name="Max Rush",
stamina_max_Name="Max Stamina",
DoT_resist_Name="DOT Resistance"
},
intelligence={
intelligence_Name="Intelligence",
magicDamage_Name="Magic Damage",
nphysCritD_Name="Non-Physical CritD",
detect_Name="Detection",
manaRegen_Name="Mana Regen",
},
wisdom={
wisdom_Name="Wisdom",
rangeDodge_wis_Name="Ranged Dodge",
magicDef_Name="Magic Defence",
manaMax_Wis_Name="Max Mana from Wisdom",--(5/1)
magicCtH_Name="Magic Cth",
heal_Name="Healing Output"
},
presence={
presence_Name="Presence",
threat_Name="Threat Scaling",
CC_resist_Name="CC Resist",
manaMax_pre_Name="Max Mana from Presence",--(3/1)
healthRegen_Name="Incoming Healing",--(0.2%/1,1/1)
CC_afflict_Name="CC Inflict"
},
finesse={
finesse_Name="Finesse",
critC_Name="Critical Chance",
DOT_afflict_Name="DOT Inflict",
stealth_Name="Stealth",
allCtH_Name="Chance to Hit",
throwCtH_Name="Throw CtH"
}
},
classes={
atkr={},
tank={},
heal={},
combo={}
},
skills={
gathering={
mine="Extraction",
herb="Herbalism",
wood="Forestry",
hunt="Venery"
},
crafting={
carp_Name="Carpentry",
smth_Name="Metalurgy",
alch_Name="Alchemy",
cook_Name="Gastronomy"
},
roles={
tank_Name="The Tower",
atkr_Name="The Blade",
heal_Name="The Cloth"
},
weaponSkills={
oneHand="One-Handed",
twoHand="Two-Handed",
throw="Throwing",
ranged="Ranged",
small="Concealed",
magic="Magic",
shield="Shield"
}
},
Statistics={
fame="Fame",
balance="Balance"
},
Assets={
money_Name="Coins",
runestone_Name="Runestones",
premiumcoin_Name=""
}
}
return statnames
end
return STAT_NAMES```
now im REALLY confused
so
datahandler is getting the ping
every script is reading properly
got it
i think
right?
FINALLY
whatever the hell this means
its crashing my login script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local bodyBuilder = ReplicatedStorage.pingables.otherside:WaitForChild("eventBodyBuilder")
local gearSwap = ReplicatedStorage.pingables.otherside:WaitForChild("eventGearSwap")
local dataQuery = ReplicatedStorage.pingables.otherside:WaitForChild("eventDataQuery")
local clientQuery = ReplicatedStorage.pingables.clientside:WaitForChild("eventDataQuery")
local dataVasily = ReplicatedStorage.pingables.clientside:WaitForChild("eventDataVasily")
local playerPrint = script.Parent:WaitForChild("loginScreen")
local thatGuy = game.Players.LocalPlayer
local guyBody = thatGuy.Character
print("login script booted.")```
im not getting the print
but i have no idea what the error is
absolutely no clue
im not sure how but some minor error like
ONE HUNDRED
lines down
was crashing it

help
i checked the server table
thats the correct path
theres a print of it even
i dont get it
function clientQuery(dataquery)
print("client data query detected for "..dataquery.."")
ClientDataModule.GetValue(dataquery)
end
clientQueryPing.OnInvoke = clientQuery```
prints fine
thats this
function ClientDataModule:GetValue(query)
print("local dataquery for "..query.."")
local result
local currentTable = rpgData
local messageParts = string.split(query,"_")
local index
for i=1,#messageParts do
print(messageParts[i])
if messageParts[i] ~= nil then
if tonumber(messageParts[i])==nil then
index = index[messageParts[i]]
else
index = index[tonumber(messageParts[i])]
end
print(index)
else
print("nil")
end
end
result = index
return result
end```
prints nil
and i have no idea why, because it really shouldn't be nil
.
clientdatacoordinator prints it fine
then tries to use the module's function to parse it and fails
????
?
string
string
why are you converting a string to a string
theyre all strings
to see if somehow that fixed it
here query is ni lright
to numbering a 1 worked once
its : not .
?
i need to lable it
index starts as the base table then INDEXES through it
progress
** You are now Level 14! **
index is just a numerical key
or any key
well its more like
key is a string index
ansfnasf
point is
index = key/access/whatever
im falling out of the world now for some reason
awesome
despite setting the position values to a point i know is not off the edge of anything
...???
?????
thats 0,0,0
the hell
THIS ISNT RIGHT EITHER WHAT THE HECK
explain
figured out the issue
its just straight up not actually reading anything

im stupid
still somehow not the correct location
but at least its nearby now
there
god that too too long
goofy ahh game
🤤
im making my own modulescript to query the item database, are you proud of me?
Yes, now to name your variables correctly... its not hard i promise
im making a second module just so that i can have my concatonation script not in the main one. i hate this game why am i making this game
what teh fuck is this
if you have to do this you're doing something wrong
definitely
no.
hold on
i mean, i COULD reference data.charstats.corestats.endurance stat DIRECTLY everytime i wanted to get the player's health from endurance
or
why dont you just
i could just have this local and do endurance.health
:findfirsthcild until you reach the final depth
or do it in steps
once for the first thingie, then for the levels and third for the other one
this script will pull each stat multiple times
doing foridos and such would be worse
bro
this way i can just type the path out manually
what the fuck
it will just run each time a stat changes or an item is equiped
this is in reaciton to your module
and ill have it detect what changed so that it only calculates what it needs to
thats not even in this thread
what the fuck
its in reference to this
Exactly
because i need each of those values?
why else would i do that
** You are now Level 13! **
or am i trippin
oh, no i COULD type "data.charstats.corestats.strength_Stat.meleeDamage"
everytime i wanted to get melee damage from strength
or just
strength.meleeDamage
after having it make these variables
whats the simpler way?
what is the simpler way to be able to reference every single index under strength by just typing it whenever i need to?
why would i loop?
i need to set very specific values in one table based on the values in another
whats the loop for?
access and set the values as you wish
in this case, just access
all this script does is get the values from the other table, and generate a table from them
then return that table
what is the loop for
then why do you need this mess
accessing the values
thats just to make it easier for me to understand it later if it bugs
??
data.<path>
what is the loop for
i KNOW the table index for everything
why would i run a loop for any of it?
to... access the values
avoid this mess
why not just do that?
in a way so, if you edit the instances, you dont have to edit the function
scalability
im still missing whats wrong with my approach
or why a loop would be of benefit
because to me it seems like MORE effort
for either the same effect
or less effect
like, why bother
dawg
i need to reference stats as i please
you're not making sense
whats not scalable?!?
just add another entry to the dataconcated table
say you want to change
???
a datra point
okay
you have to change the function
no?
if you did this with
YES
if you need to change
ONE
of these values
you have to edit the function
huh??
no i dont?
what
what are you talking about
i have a seperate table for names for a reason
YES YOU DO
i should NEVER need to change ANY index name
if you have to edit
any
of these vaslues
change these names
WHAT VALUES
or add a new value

