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

Script that is supposed to give a player a sword when they are on a certain team isn't functioning?

I don't have a clue what is wrong

Please help,

Script:

local tool = game.ReplicatedStorage.ClassicSword
if game.Players.LocalPlayer.Character.TeamColor == BrickColor.new("New Yeller") then
	tool:Clone().Parent = game.Players.LocalPlayer.Backpack	
end

1 comment

0

add a wait() at the top of the script

1 answer

If you have FilteringEnabled, you should give the sword from a server script so that all other players can see that they have it.

game:GetService("Teams")["TeamNameHere"].PlayerAdded:Connect(function(plr)
	local tool = game.ReplicatedStorage.ClassicSword:Clone()
	tool.Parent = plr.Backpack
end)

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