#Script unable to detect object that exists

1 messages · Page 4 of 1

fossil osprey
#

because they rely on the previous one

ionic mica
#

im guessing yes

#

thats if the compiler defines them in order

#

which i dont know if it does

#

you have to test that

ionic mica
#

yes

#

ok

#

more than likely you cant do that

#

itemFile = itemDataBase[itemType][itemTier][itemID]
itemColor = itemFile:GetAttribute("Color")

fossil osprey
#

so, what does this mean

#

why the :

ionic mica
#

hold on

fossil osprey
#

couldnt i just

#

if classname == thing then stuff else return nil?

ionic mica
#

its for auto-complete

fossil osprey
#

that way it feeds back a result

ionic mica
fossil osprey
#

that there was an issue

ionic mica
fossil osprey
#

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

ionic mica
#

i make it not fire a function with a non-player thing

fossil osprey
#

whereas the classname thing i can make it print that it went wrong

ionic mica
#

cuz that would be

#

dumb

ionic mica
#

i also do that

ionic mica
#

but

fossil osprey
#

why is this close bracket?

#

shouldnt it be closed around the functions?

ionic mica
#

the official lua website explains it better than i can

ionic mica
fossil osprey
#

so, it should be closed?

#

oh

ionic mica
#

i dont know what you're talking about

#

OH

#

youre defining it

fossil osprey
#

at the start of the module script

ionic mica
#

along the script

fossil osprey
#

shouldnt it be after all the functions before the return?

ionic mica
#
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

fossil osprey
#

ohhh

#

thats why the .

#

got it

ionic mica
#

heck, you can even do

local thisModule = {}

thisModule[workspace.Part] = function()

end

return thisModule
#

cuz dictionaries support instance keys too lol

fossil osprey
#

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? JayaPls

ionic mica
fossil osprey
#

so defaultData_exe.tableiwant.path

#

?

ionic mica
# fossil osprey can pleaaaase have a copy of the client script to handle data? <:JayaPls:9914403...

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
ionic mica
fossil osprey
#

what does this mean

ionic mica
#

playerData, "tableIWant", "wHATEVER"

fossil osprey
ionic mica
fossil osprey
#

i forgot at one point i did a replace all

ionic mica
#

lol

fossil osprey
#

while removing stat names

#

to put those in a non-per-client table

ionic mica
#

bleh

#

ok im gonna add path tags now

ionic mica
#

a folder

fossil osprey
#

okay

#

was worried i somehow was missing a service

ionic mica
fossil osprey
#

remote event or remote function?

#

function, right?

ionic mica
#

both events

#

they dont need to return anything

fossil osprey
#

oh

#

the first one is a localscript, right?

ionic mica
#

yes

fossil osprey
#

dont see the error...

ionic mica
#

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

fossil osprey
#

i searched for }

#

no clue

ionic mica
#

can you send it

fossil osprey
#

oh

ionic mica
#

found it?

fossil osprey
fossil osprey
ionic mica
#

lmao

fossil osprey
#

oopsie

fossil osprey
#

necessary?

#

or can i just try and path, if nil create?

ionic mica
#

that'd be best

#

or just

#

return nil

#

if theres gonna be nothing there when it creates it it will return empty anyways

fossil osprey
#

no i mean if later i want to add something

ionic mica
#

then you :SetValue()

fossil osprey
#

aight

ionic mica
#

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

fossil osprey
#

nah, i have the name table seperate for SPECIFICALLY the purpose of not having to replace indexes

ionic mica
#

im talking about replacing a value

fossil osprey
#

why red

ionic mica
#

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

fossil osprey
#

this too

ionic mica
#

hover your mouse over it

#

its self explanatory at this point

fossil osprey
#

okay, i figured both out

#

one was a local i forgot to set

#

one was i renamed a local to my style

ionic mica
#

why do you call variables "local"

#

variables can be not-local

fossil osprey
#

because if i say local you know its a local variable

#

i call global variables globals

ionic mica
#

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

fossil osprey
#

so

ionic mica
#

(also, saying global is common, but saying "local" isnt, so usually you say "local variable")

fossil osprey
#

THIS i dont get

#

why is one a colon and the others are periods

ionic mica
#

you sure you're ready?

#

well

#

gimme a sec

fossil osprey
#

do i need to change this, right?

#

because it isnt inside the same script anymore

ionic mica
#

?

#

you dont just

#

local DEFAULT_DATA = require(script.DefaultData) ?

#

so you still have it defined

ionic mica
#

read that

#

its also explained

#

here

fossil osprey
#

is this an unreliableremoteevent?

ionic mica
#

custom signal module

#

its so i dont spam bindable events cuz theyre not great

#
  • i can pass connections and
#

its just, better.

#
fossil osprey
#

do i need to instance anything?

ionic mica
#

i dont even use that module

#

iots just a residue from when i was scripting

fossil osprey
#

too unreliable?

ionic mica
ionic mica
fossil osprey
ionic mica
#

incredibely reliable

#

i just dont use it in that specific script

fossil osprey
#

(twas a joke)

ionic mica
#

so

#

thats all the instance you need

fossil osprey
#

oh

#

okay

ionic mica
#

but the signals themselves are literal signals

#

like RBXScriptConnections

fossil osprey
#

ohhh

#

its a modulescript that acts as a bindable/remote

#

but can do both?

#

yes?

ionic mica
#

huh

#

no it cant do server-client communication

fossil osprey
#

oh

ionic mica
#

its just a signal library so i can add signals to my own classes

fossil osprey
#

ahh

ionic mica
#

or connect other stuff directly without using bindale events

fossil osprey
#

i can safely not use it though

#

right?

ionic mica
#

better than remote events

#

yknow how part.Touched is an event

#

with that module i can create one of those events

fossil osprey
#

nothing in that scriped will break, right?

fossil osprey
ionic mica
#

i forgor to remove it

fossil osprey
#

so this

ionic mica
#

this is my simple input module

fossil osprey
#

just pings the module

#

right?

ionic mica
#

it runs the functions yeah

fossil osprey
#

is there any benefit to that

ionic mica
#

to what?

#

we're having 2 convos

#

lol

fossil osprey
#

instead of just having the module's code be in that script?

ionic mica
#

so other local scripts can get values from the player's data

fossil osprey
#

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

ionic mica
#

if i had to get+

fossil osprey
#

less scripts

#

whats the difference between these?

ionic mica
#

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

ionic mica
#

one is requiring a module

#

the other is waiting for a child

fossil osprey
#

require(thing.otherthing)
thing:WaitForChild("otherthing")

#

arent they the same?

ionic mica
#

no

fossil osprey
#

or is there some advantage to one over the other?

ionic mica
#

require returns what the module contains

#

waitforchild returns the instance module itself

fossil osprey
#

ohhh

#

okay

#

so for modulescripts use require

#

for instances use wfc?

ionic mica
#

yes, if you want to get what the module returns

fossil osprey
#

gotcha

ionic mica
fossil osprey
#

i always use wfc now

ionic mica
#

shouldnt*

fossil osprey
#

its removed the need for taskwaits

fossil osprey
ionic mica
fossil osprey
#

or if the script is a child of it

#

ye

#

sorry, i meant i use them for my starting variables

ionic mica
#

if you dont know IF something exists then :FindFirstChild

fossil osprey
#

or if i need to wait for a clone of something to be in its new parent

ionic mica
#

you can also wait for events

fossil osprey
#

this makes sense, right?

ionic mica
fossil osprey
#

that way i can always know if its remote or not

ionic mica
#

not even a little

fossil osprey
#

and it keeps them away from other things

#

so, it makes SOME sense?

#

just not total sense?

ionic mica
fossil osprey
#

uhhh

#

should i not?

ionic mica
#

which environment uses them?

fossil osprey
#

client currently

ionic mica
#

then call it ClientSide

fossil osprey
#

and have a seperate one for serverside?

ionic mica
#

no

#

serverside goes in serverstorage

fossil osprey
#

oh those will-ye

ionic mica
#

its like you're saying "other side compared to x"

fossil osprey
#

cross from client to server

#

or vice versa

ionic mica
#

yes, i get that, but a clearer name would be "crossBoundary"

fossil osprey
#

(goto the) otherside

#

no

#

clientSIDE

#

serverSIDE

#

otherSIDE

ionic mica
#

congrats

#

you know how to use uppercase letters

#

that doesnt help

fossil osprey
#

it make sense in that context

#

that it only contains events

ionic mica
#

"side" isnt a formal definition

#

server-client boundary is

fossil osprey
#

that side of the server/client boundary

#

seeeeee

ionic mica
#

yes but you're taking it as a physical space

#

aka word play

#

like

#

its fine

#

but its not fine

fossil osprey
#

okay so, thats irrelevant in the grander scheme of things

ionic mica
#

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 ;)

fossil osprey
#

should for inventory i just index forido through the table until i find an itemstack of -1?

ionic mica
#

whar

#

-1 means empty or what?

#

what are you talking abou

fossil osprey
#

empty

#

slot.itemstack==-1

ionic mica
#

nil is better in this case

#

anyways

#

thats why im adding tags

fossil osprey
#

i want to keep it all numbers always numbers

#

so if it becomes nil via error i can catch the error

ionic mica
fossil osprey
ionic mica
#

no one does that

fossil osprey
#

if nil warn"error at"..table.."."..table.slot..""

ionic mica
#

to my system

#

so i can say

fossil osprey
#

okay, but without that

ionic mica
#

DataModule:SetValue(player, 0, "Inventory", "@find", -1)
DataModule:SetValue(player, 0, "Inventory", "@find_if[self_quantity]", -1)

ionic mica
#

you'd have to iterate through everything

fossil osprey
#

okay

#

oh

#

which module should i access the table from?

ionic mica
#

?

#

what table

fossil osprey
#

the client stats/inventory/etc

ionic mica
#

from... where you need it?

#

if my gui needs the player's data then i require the module and use :GetValue() as needed

fossil osprey
#

okay

covert portalBOT
#

studio** You are now Level 13! **studio

fossil osprey
#

so... hm

#

so, how would i do that for the server inventory manager script?

#

just

#

datamodule:getvalue(inputs)?

ionic mica
#

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

fossil osprey
#

like a folder structure?

#

:3

#

(joke)

fossil osprey
#

i figured it was a remote event

ionic mica
#

back

ionic mica
#

containing my remotes

fossil osprey
#

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?

ionic mica
#

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

fossil osprey
#

fair enough

#

is the number bit just limiting the output to a number?

ionic mica
#

this |?

#

|

fossil osprey
#

ye

ionic mica
#

that means "or"

#

string or number

fossil osprey
#

oh

#

when would- ah

#

wait

ionic mica
#

cuz my database will only string and number indices

fossil osprey
#

no yeah when would it be a number?

ionic mica
#

arrays

#

say i want to equip an attack to slot 4

fossil osprey
#

stats_attacks_4

ionic mica
#

:SetValue(player, "Punch", Attacks, 4)

fossil osprey
#

the limit bits are too confusing ;-;

ionic mica
ionic mica
#

do you mean the type checking?

fossil osprey
#

ye

ionic mica
#

did you read the luau.org article i sent you

fossil osprey
#

i'll just ifnil them out

ionic mica
#

i feel like it explains them very well

ionic mica
fossil osprey
#

visually confusing*

ionic mica
#

(assert = ifnil)

fossil osprey
#

im struggling enough with modulescripts

#

i dont need more to learn right now

#

im still working on making inventory work

#

so wait

ionic mica
#

well you were copying my scripts

#

thats why they're there

fossil osprey
#

should i make a new modulescript that checks for the first openslot in the inventory?

ionic mica
#

tags...

#

@firstAvailable :)

fossil osprey
#

otherwise i think i need to forido and refenence the module EACH TIME from the serverscript

ionic mica
fossil osprey
#

how does the tag system work?

ionic mica
#

i have a function which processses the tag into an index

fossil osprey
#

every time the inventory updates it gets the lowest index of the array not filled and marks it?

ionic mica
fossil osprey
#

wouldnt that just... be foridoing at a different time?

ionic mica
#

yes, but i avoid the hassle of doing it from the script that requires it

fossil osprey
#

okay

#

so, not specifically more lag-efficient

ionic mica
#

just at a different time

fossil osprey
#

then just module.inventory()

#

and the module foridos

ionic mica
fossil osprey
ionic mica
#

its just this

fossil osprey
#

so im not doing a silly wierd thing again

ionic mica
fossil osprey
#

LET ME LEARN ONE THING AT A TIME

ionic mica
#

if #currentTable == 50 then return nil end

fossil osprey
ionic mica
#

im just showing you the function

#

pleh

#

not the tags

fossil osprey
#

oh

#

wait

#

so

#

should this be function.inventory

#

or function:inventory

ionic mica
#

do you need self?

fossil osprey
#

what is self

#

ohhh

ionic mica
#

you didnt read what i sent lol

fossil osprey
#

so if i need to reference the tables

#

:

#

otherwise

#

.

ionic mica
#

yes

fossil osprey
#

right?

#

YAY

ionic mica
#

but sometimes i just do it on modules because it looks like a service :]

fossil osprey
#

so

#

or some other symbol than .

#

?

ionic mica
#

what is rpgData?

#

isnt that a module

fossil osprey
#

... like this?

#

then just return that.slot?

ionic mica
#

wut duh hell

#

um

fossil osprey
#

right?

ionic mica
#

[slot]

fossil osprey
#

the slot in your inventory

ionic mica
#

i guess

#

im not really sure what you're doing but

#

my guess is yeah

fossil osprey
#

right?

ionic mica
#

return currentSlot

#

yea

fossil osprey
#

then print a bunch of vars as slot's data, send it back?

ionic mica
#

whatr

fossil osprey
#

unless returning currentslot will give me all of the data in it

ionic mica
#

it will...

#

wait what

ionic mica
#

why cant you just

fossil osprey
ionic mica
#

:getdata and specify "inventory_page_slot"

fossil osprey
#

any quest with requirements

#

especially the add and remove commands

#

i want to be their own functions

#

anyway

ionic mica
#

whatever you say ig

fossil osprey
#

will returning currentslot return all of its data?

ionic mica
#

yes

fossil osprey
#

okay

ionic mica
#

youre testing while you do all this right?

fossil osprey
#

yesnt

ionic mica
#

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

fossil osprey
#

i cant test it rn

ionic mica
fossil osprey
#

i need to convert EVERYTHING to using the database system first

ionic mica
#

honestly i just add commands in a random script to test stuff

fossil osprey
#

when you forget to add something to your table:

#

(character name)

#

OH GOD I NEED TO ADD ENTRIES FOR CHARACTER LOOK

ionic mica
#

yeap

#

thats easy if you do it right

#

hairID = 5

#

etc

#

thats the easiest thing, cuz you have like a bajillion values for stats

fossil osprey
#

mhm

#

out of curiosity

#

have you ever heard of an MMORPG called "Runes of Magic"?

ionic mica
#

no

fossil osprey
#

oh and i ended up making stat names a seperate moduletable btw. MUCH easier

fossil osprey
ionic mica
#

also cool

fossil osprey
fossil osprey
ionic mica
#

what is it called

ionic mica
#

:/

#

i guess you're gonna like it

#

when you get to it

fossil osprey
#

why i name things wierdly:

ionic mica
#

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

fossil osprey
#

anyway

#

how/when should i send the playerdata to the client as their copy?

ionic mica
#

i send all the data once when they join

#

and then send any updates to them

fossil osprey
#

how do you "send all data"?

ionic mica
#

remoteEvent:Fire(player, data)

#

lol

fossil osprey
#

okay

ionic mica
#

literally send the entire data table

#

just once

#

when they join

fossil osprey
#

cant i just set these

#

up here?

#

or is this just your way of organizing confusing me?

ionic mica
#

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

fossil osprey
#
-- 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?

ionic mica
#

yeah see the comments suggest that dataPing & dataVasily are services

#

when they're not

ionic mica
fossil osprey
#

red october

#

(cause it only pings once, when a player joins; and never again)

fossil osprey
#

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?

ionic mica
#

am back

ionic mica
#

i believe the script will yield infinitely if it never returns something

fossil osprey
#

ye so it will ping the data, when the data sends back it will ping back

#

right?

ionic mica
#

yes... but for what purpose?

#

what will it "send back"?

ionic mica
fossil osprey
#

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

ionic mica
#

log-in scrip´t?

#

you have an account system?

#

ewrhg

#

ok whatever

#

you do you

ionic mica
fossil osprey
ionic mica
#

well thats an understandable name, at least.

fossil osprey
#

even if i only impliment a single character slot per player

#

it still does enough on login that it needs a login screen

ionic mica
fossil osprey
#

it also means i can divert new players to a character menu using the login

ionic mica
#

cuz you'll also need that

fossil osprey
#

it's both

ionic mica
#

use CPS to load content

#

yae

#

ok

fossil osprey
#

unless you mean between places

#

then idk

ionic mica
#

just call it "loading screen" cuz getting data is a way of loading

ionic mica
fossil osprey
#

every non-starter place will just have a loading screen

ionic mica
#

you'll probably want the same data module script in all places right?

fossil osprey
#

only the "hopping off" one will use a login

ionic mica
#

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

fossil osprey
#

wow

#

thats

#

REALLY neat

ionic mica
#

extremely

ionic mica
fossil osprey
#

better than opening every place and manually doing it...

ionic mica
#

definitely

#

and they're private

#

so you dont have to worry about people peeking into your code

fossil osprey
#

so

#

when the loginscript pings dataVasily

#

it will invoke the server, then send the invokation to the clientdatamodule

#

right?

ionic mica
#

cafchahfg

#

names

ionic mica
#

well

#

yes but

#

you're not returning anything

fossil osprey
ionic mica
#

why are you using remotes if

#

ok

ionic mica
fossil osprey
#

the localplayer

ionic mica
#

did you send it twice?

fossil osprey
#

you should remember that by now

ionic mica
#

:InvokeServer(player, player)

#

cuz if you just do

fossil osprey
ionic mica
#

:InvokeServer(player) it doesnt pass that to the client

fossil osprey
#

oh it automatically sends player

#

RIGHT

#

i forgot

ionic mica
#

and more importantly

#

what the fuck is "dataKonolov"

#

like "thatGuy" made some kind of twisted far off sense

#

here, no idea.

fossil osprey
#

konolov is the sub that sank red october

#

vasily pinged

#

konolov detected it

#

sent a torpedo

ionic mica
#

😭

fossil osprey
#

its an old movie and an older book series i get it

ionic mica
#

no excuse at this point

fossil osprey
#

but it makes sense if you get the vasily reference

ionic mica
#

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

fossil osprey
#

thats even more vague than my classic movie references

ionic mica
#

BECAUSE YOU UNDERSTAND THEM

#

i cant even google your variable names

#

WHICH ONE HUH

#

WHICH VASILY

#

OR IS IT ONE OF THESE?

fossil osprey
#

i spelled it wrong mb

ionic mica
#

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()

fossil osprey
#

now im just confused

ionic mica
#

i give up with those names

#

youre gonna have to clarify all names when you ask me something

#

or well

fossil osprey
#

anyway

ionic mica
#

ask anyone really

fossil osprey
#

its a classic movie scene

ionic mica
#

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

fossil osprey
#

tragedy

#

anyway

#

does the client data stuff need to know the localplayer or will it always know that because its perclient

#

right?

ionic mica
#

you can always access the local player from a local script or module

#

game.Players.LocalPlayer

fossil osprey
#

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?

#

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?

fossil osprey
#

why would this be happening?

#

it shouldnt be firing

#

wth

#

nvm im stupid(again)

fossil osprey
#

FINALLY

ionic mica
#

iim baxck

#

well

#

whjatever

#

you solved it

fossil osprey
#

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

fossil osprey
#

i checked the server table

#

thats the correct path

#

theres a print of it even

#

i dont get it

ionic mica
#

toko ma to ne dia da

#

gimme ma sec

#

and ill see

fossil osprey
#

its reaching the module correctly

#

not a clue

ionic mica
#

print messageData

#

what type is messageData?

fossil osprey
#
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

ionic mica
fossil osprey
#

clientdatacoordinator prints it fine

#

then tries to use the module's function to parse it and fails

ionic mica
fossil osprey
ionic mica
#

string

fossil osprey
ionic mica
#

why are you converting a string to a string

fossil osprey
#

theyre all strings

fossil osprey
ionic mica
#

💀

#

why would it

fossil osprey
#

to numbering a 1 worked once

fossil osprey
#

?

ionic mica
#

you defined it in the module as a method with :

#

and are calling it with .

fossil osprey
#

THATS IT?!?

#

i dont get it

#

it uh

ionic mica
#

different error

#

thats progress

fossil osprey
#

SHOULDNT BE INDEXING ANYTHING NIL

#

different print

ionic mica
#

why the hell is index a table

#

ur variable names

fossil osprey
#

i need to lable it

ionic mica
#

are

#

ASS

fossil osprey
fossil osprey
#

progress

covert portalBOT
#

studio** You are now Level 14! **studio

ionic mica
#

or any key

#

well its more like

#

key is a string index

#

ansfnasf

ionic mica
#

index = key/access/whatever

fossil osprey
#

im falling out of the world now for some reason

ionic mica
#

awesome

fossil osprey
#

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

ionic mica
fossil osprey
ionic mica
#

Yes, now to name your variables correctly... its not hard i promise

fossil osprey
#

inventory has been achieved

fossil osprey
ionic mica
#

if you have to do this you're doing something wrong

#

definitely

fossil osprey
#

no.

ionic mica
#

YES

#

OBJECTIVELY

fossil osprey
#

im just a layer nut

#

not objectively

ionic mica
#

hold on

fossil osprey
#

i mean, i COULD reference data.charstats.corestats.endurance stat DIRECTLY everytime i wanted to get the player's health from endurance

#

or

ionic mica
#

why dont you just

fossil osprey
#

i could just have this local and do endurance.health

ionic mica
#

:findfirsthcild until you reach the final depth

ionic mica
#

once for the first thingie, then for the levels and third for the other one

fossil osprey
#

this script will pull each stat multiple times

#

doing foridos and such would be worse

ionic mica
#

bro

fossil osprey
#

this way i can just type the path out manually

graceful cradle
#

what the fuck

fossil osprey
#

it will just run each time a stat changes or an item is equiped

ionic mica
fossil osprey
#

and ill have it detect what changed so that it only calculates what it needs to

ionic mica
fossil osprey
#

thats not even in this thread

graceful cradle
fossil osprey
#

hm

#

should i have the concatonated stats be only client side?

graceful cradle
#

why do you even

#

do that

ionic mica
ionic mica
fossil osprey
#

why else would i do that

graceful cradle
#

wait theyre all

#

a leaderstat

covert portalBOT
#

studio** You are now Level 13! **studio

graceful cradle
#

or am i trippin

fossil osprey
#

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

graceful cradle
#

theres a simpler way to do that

#

but whatever floats your boat

fossil osprey
#

whats the simpler way?

fossil osprey
#

what is the simpler way to be able to reference every single index under strength by just typing it whenever i need to?

ionic mica
#

loop

#

if you cant, your database is inherently flawed

fossil osprey
#

why would i loop?

#

i need to set very specific values in one table based on the values in another

ionic mica
#

then do that

#

but automatically

#

loop throughthem

fossil osprey
#

whats the loop for?

ionic mica
#

access and set the values as you wish

fossil osprey
#

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

ionic mica
fossil osprey
fossil osprey
#

data.<path>

#

what is the loop for

#

i KNOW the table index for everything

#

why would i run a loop for any of it?

ionic mica
#

to... access the values

fossil osprey
#

???

#

but

#

i KNOW all the values

#

(thats an exampe)

ionic mica
fossil osprey
#

why not just do that?

ionic mica
#

and

#

be able to easily edit it

fossil osprey
#

or this if the variables as so bad

#

what is the loop actually supposed to achieve?

ionic mica
#

scalability

ionic mica
#

mg

#

gsdmogdsm

fossil osprey
#

?

#

im just confused why i would ever need a loop for this

fossil osprey
#

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

ionic mica
#

dawg

fossil osprey
#

i need to reference stats as i please

ionic mica
#

nothing i tell you will convince you

#

you just refuse

#

to make this scalable

fossil osprey
#

you're not making sense

fossil osprey
#

just add another entry to the dataconcated table

ionic mica
#

say you want to change

fossil osprey
#

???

ionic mica
#

a datra point

fossil osprey
#

okay

ionic mica
#

you have to change the function

fossil osprey
#

no?

ionic mica
#

if you did this with

ionic mica
fossil osprey
#

no?

#

what

ionic mica
#

ONE

#

of these values

#

you have to edit the function

fossil osprey
#

huh??

#

no i dont?

#

what

#

what are you talking about

#

i have a seperate table for names for a reason

ionic mica
#

YES YOU DO

fossil osprey
#

i should NEVER need to change ANY index name

ionic mica
#

any

#

of these vaslues

#

change these names

fossil osprey
#

WHAT VALUES

ionic mica
#

or add a new value