#need help sorting out a character selection bug with anims

1 messages · Page 1 of 1 (latest)

novel comet
#

So i've made a character selection feature but is there any way i can have each character with their OWN animations? because the animations dont work outside of startercharacterscripts from what ive learnt so far.

#

I also tried just putting it into the rigs animate and it didnt work

#

this is like

#

the last step in my game too so once i work this out it'll be fire

oak bone
novel comet
#

thing is every character has to be named "StarterCharacter" for it to work

mild vortexBOT
#

studio** You are now Level 4! **studio

oak bone
#

oh is there only one character?

novel comet
#

until i work out the problems with the animations yeah

#

i can TRY and change them but last time i checked it doesnt work

oak bone
#

so how do you differentiate one character from another
why does one have Animation1 while another has Animation2?

do you select from a gui

novel comet
#

oh ok nevermind im an idiot it works

oak bone
#

oh lol nice

novel comet
#

i could change their names

#

im really not good at scripting so im just kind of

#

entirely forcing things to work

oak bone
#

we getting better everyday 🙏

novel comet
#

trust

#

like

#

i couldnt figure out how motor 6D and rigs worked

#

so i made my own rig in blender

#

and that ended up working

oak bone
#

😭 took it into your own hands

novel comet
#

blender is easy as shit i found out too

#

but anyways how would i go around making a module

#

ive never messed with them before

#

you'd have to spoonfeed me it 💔

oak bone
#

hmmm how would i explain

#

lemme find an example

#

so module scripts are used to be able to reuse code like functions tables etc

#
-- ServerScriptService / ModuleScript

local CharacterStats = {
    Starter = {
        Health = 100,
        Damage = 10,
        WalkSpeed = 16,
    },
    
    Mage = {
        Health = 80,
        Damage = 25,
        WalkSpeed = 14,
    },
    
    Orc = {
        Health = 150,
        Damage = 20,
        WalkSpeed = 12,
    }
}

return CharacterStats
#

imagine you wanted to save your characters a player could be digitally

#

and add some properties

#

you can do something like this, even saving clothing IDS body colours whatever you want

#

then make it so they can choose with a gui or just randomly assign them one

#

if you ever want to buff the orcs, just make their damage 30

#

its great for if you want to update a game cause making changes is quite easy

novel comet
#

i th ink i drooled a little

oak bone
#

Theres alot to them, so youd need to deep dive but i hope it helps just a bit

novel comet
#

ill try and understand it

oak bone
#

its really helpful to learn so give it a shot

novel comet
#

so let me try and get this straight

#

a module would like

#

let me be able to use a different script inside of it

#

without having to type it all out again?

#

or am i an idiot

oak bone
#

you create functions inside of the module script

#

so lets say im using a database

#

i can make a function in the module dedicated to grabbing a players data all i need to do is pass the (player) paramter
GetData(player)

#

then i can have a function just for updating the players coins

#

so you can create this organisation in one module

#

this is the explanation from roblox themself

#

itll be better than i can whip up

novel comet
#

woah dont whip me

#

😨

#

ohh

#

ok i kind of get it

#

so you can put another script in a module

#

and use local MyFunctions = require(script.Parent.MyFunctions) to pull them into the script

#

thats you're currently doing

#

ok i get it now

oak bone
#

n ono

#

you dont exactly put a script into a module

#

you can reference a module function from another script

#

MyFunctions = require(script.Parent.MyFunctions) exactly this

novel comet
#

can i just

#

can i just put them in here

oak bone
#

Module scripts go in serverscriptservice

#

You hold sensitive data in them so putting it on the client is very unideal

mild vortexBOT
#

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

novel comet
#

i meant animations

#

i tried it and it didnt work

oak bone
#

Hmmm I have never tried that so I couldn't say your wrong too

But I'll say anytime I've seen someone store animations it's in a table

#

Or stick it in a folder in server storage

#

Animation object