#Sword Setup

1 messages · Page 1 of 1 (latest)

odd bobcat
#

I need some advice on my sword setup.
Which is better for scalability? And security.
Cuz idk if int value objects in replicated can be changed by exploiters.

Should I keep it text formatted or make it into object required.
Example:
replicated storage > ClassicSword
With child objects:

Damage int val 40
Roblox sound object
SlashEffect
Local "Ability Script"

or I make it like that other image where I have all the effects and just code the abilities in the general script.

arctic oracle
#

But it won't replicate

odd bobcat
odd bobcat
arctic oracle
#

Almost all of them can be replaced by attributes

odd bobcat
#

or my code

arctic oracle
#

I would keep the data for stuff like damage in a dict, like you have it

odd bobcat
#

cuz ive seen like big games js keep em in a folder

#

but it might get messy idk

arctic oracle
hybrid pastureBOT
#

studio** You are now Level 11! **studio

arctic oracle
#

Replicatedstorage.Assets[movename]

#

Or similar

odd bobcat
arctic oracle
#

And if you want scalability I recommend creating a type for the weapon data

#

And then casting the module return value to map<string, WeaponData>

#

Well

#

Doesn't directly make it more scalable but it makes you think about how you structure data

#

Which usually leads to better results

odd bobcat
#

like typeof and stuff?

arctic oracle
#

local a:string = ""

#

Or

#
type Map<t,k> = {[t]:k}

Local a:Map<string, number> = {
Example= 999
}```
odd bobcat
#

🤔 seems kinda abstract. Whats the benefit

arctic oracle
#
local function dosomemath(numbers:{number}, operator: "+" | "-" )
local total = table.remove(numbers, 1)

for _, num in numbers do 
     if operator == "+" then
    total += num
    continue
    end

    total -= num
end

return total
end
#

And then calling this function would prompt you with + or - for the second arg

#

Yk

#

Also I'm on mobile so

#

Too lazy for formatting

odd bobcat
#

🤔 oooo type annotations i forgot about those yeah i prob gotta do some

hot crow
#

will say tho it helps build objects while they are incomplete

#

don't need constructor to write any implementation since the object type should already define everything the constructor will output