Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

'Backpack is not a valid member of Player' help me please?

Hello !, I have a problem in a script, what I want is that when the player joins the Team a weapon appears automatically, but I get an error saying the following: 'Backpack is not a valid member of Player'.

This is the 'Script':

print("hola")
local Teams = game:GetService("Teams")
 
local team = Instance.new("Team", Teams)
team.AutoAssignable = true

print(team.Parent, team.TeamColor)

local tool = game.ReplicatedStorage.Pistola
tool:Clone().Parent = team

local function armas(plr)
	for i,v in pairs(team:GetChildren())do
		print(v)
		local Tools = v:Clone()
		Tools.Parent = plr.Backpack
		print(plr)
	end
end

local function onPlayerJoinedTeam(player)
	print(player.Name, "joined the team")
	armas(game.Players.LocalPlayer)
end
 
team.PlayerAdded:Connect(onPlayerJoinedTeam)

By the way I'm using a normal Script located in 'Workspace'.

I hope you help me ... Thank you!.

2 comments

0

Are you using a local script or a regular script. And is FE on or off?

0

Script Regular. ¿FE?

1 answer

✓ Accepted answer

plr:WaitForChild("Backpack")

1 comment

0

I forgot that, thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.