Added Player.Teamcolour if statement, now does not work or give error. What is wrong?
local serverstore = game:GetService("ServerStorage") local players = game:GetService("Players") local cavalry = serverstore:WaitForChild("Cavalry Sword") local groupid = 1141913 players.PlayerAdded:connect(function(player) if player:IsInGroup(groupid) then if player.TeamColor==BrickColor.new("Bright red") then player.CharacterAdded:connect(function() cavalry:Clone().Parent = player.Backpack end) end end end)
It looks to me like you are trying to access the ServerStorage. Players cannot access the ServerStorage, try ReplicatedStorage instead:
local serverstore = game:GetService("ReplicatedStorage")--added replicatedstorage local players = game:GetService("Players") local cavalry = serverstore:WaitForChild("Cavalry Sword") local groupid = 1141913 players.PlayerAdded:connect(function(player) if player:IsInGroup(groupid) then if player.TeamColor==BrickColor.new("Bright red") then player.CharacterAdded:connect(function() cavalry:Clone().Parent = player.Backpack end) end end end)
All you need to do is move your tool into replicatedstorage. Hope I helped!