Object is not a valid member of RBXScriptSignal

Hi! So I was making a function in server script like this

 local function equip(plr,skin)
	local char = plr.CharacterAdded
	local pistol = char.pistol
	pistol.TextureId = skin.TextureId
end

(i am using custom character with pistol model)

pistol is not a valid member of RBXScriptSignal

I was searching same problem on other topics but it didnt helped me. So idk what to do

Thank you guys.

1 Like

CharacterAdded is an event.
plr.Character is what you want.

1 Like

You’re looking for the property Character, not CharacterAdded. Try this instead. If this doesn’t work, then you haven’t properly connected the function. If that’s the case, try this code:

local function equip(char,skin)
	local pistol = char.pistol
	pistol.TextureId = skin.TextureId
end

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(equip)
end)

Also, heads up — CharacterAdded does not return second parameters.

1 Like