The following code is a server script and there are no errors in the output. The following code will give the players a tool in replicated storage and it doesn't seem to work.
local plrs = game.Players:GetPlayers() local teams = game:GetService("Teams") local shark = teams:WaitForChild("Shark") local tool = game:GetService("ReplicatedStorage"):WaitForChild("Shark Tagger") while wait() do if plrs.TeamColor == shark.TeamColor then tool:Clone().Parent = plrs.Backpack end end
One idea.
Consider changing the following:
local plrs = game.Players:GetPlayers() local teams = game:GetService("Teams") local shark = teams:WaitForChild("Shark") local tool = game:GetService("ReplicatedStorage"):WaitForChild("Shark Tagger") while wait() do if plrs.TeamColor == shark.TeamColor then -- shark.TeamColor isn't a valid color. Try changing shark to a similar color. tool:Clone().Parent = plrs.Backpack end end
I hope it will work! :D