#Attaching a different weapon based on what character you are playing as

1 messages · Page 1 of 1 (latest)

mellow sleet
#

Im making a battlegrounds game, and each charcter uses some sort of weapon. I have a script that attaches a weapon to the player, but idk how to change what weapon it ataches based on what character they are. (The code shown is for someone who dual weilds, but you get the idea)

#

im storing the current character in a module script fyi

nocturne leaf
#

is this a oop script

#

the character one

#

on the bottom

nocturne leaf
#

just make them inside the model in studio

#

and refference them in script

#

its better for performance

#

to get the weapon u can just check what weapon the character has equipped

#

and loop thru the storage folder

#

and check if it matches to the characters

#

then clone it

#
local currentWeapon = module.GetWeapon(character)
for _,v in rs:GetChildren() do
   if v.Name == currentWeapon then
      -- clone and weld
  end
 end
mellow sleet
#

@nocturne leaf what is an oop script?

nocturne leaf
#

the same way a part has things like color and shape

#

u can make a custom character class

#

that has functions aswell as properties

mellow sleet
#

then yes