Can not get weapon from folder

hello devform its me again, i have recently ran into a problem with the fps framework that i am creating. The problem that I am facing is that i am trying to get the chosen weapon from the main weapon folder but it wont work.

the main weapon folder

local plr_weapons = rep:WaitForChild("weapons").primary

the script

	if headshot then
		for index, wepName in pairs(plr_weapons:GetDescendants()) do

please help. i have been trying to solve this for weeks but i don’t know what to do :frowning:

It doesn’t look like you’re trying to look up for a specific weapon, this only spews out all the descendants of the primary folder, which includes children of children. Are you certain that you didn’t mean to use GetDescendants but GetChildren?

Sorry late reply I will try that now

I seem to have spotted my problem. The way weapon selection was sent up was that it was being done on the client and not the server. So to the server the weapon never really “existed”

1 Like