Problem with clothing the players on a team

Hello,
im trying to kit all the players on a team when a button is clicked.
i tried to fire a remote event when the button is clicked but the players clothes doesnt change
here the server script:

local rs = game:GetService("ReplicatedStorage")
local a = rs:WaitForChild("Kits").Kit
local Players = game:GetService("Players")

local function GiveKit(player)
local value = player.PlayerGUI:WaitForChild("Start").TeamKit.AwayKit.KitValue
for i,v in pairs(Players:GetPlayers()) do
if v.Team == game.Teams.Away then
if value.Value == "Royal Kit" then
v.Character:FindFirstChild("Pants").PantsTemplate = --the id
v.Character:FindFirstChild("Shirt").ShirtTemplate = -- the id
elseif value.Value == "Occult Kit" then
v.Character:FindFirstChild("Pants").PantsTemplate = -- the id
v.Character:FindFirstChild("Shirt").ShirtTemplate = -- the id
              end
           end
     end
end

a.OnServerEvent:Connect(GiveKit())

the local script on the button:

local rs = game:GetService("ReplicatedStorage")
local a = rs:WaitForChild("Kits").Kit

script.Parent.MouseButton1Click:Connect(function()
a:FireServer()
end)

i will appreciate every help

Can you provide the IDs? It’s more than likely you’re setting it to the clothing ID, rather than the actual asset ID of the clothing. When you insert a clothing ID into a shirt/pants template in studio, it is automatically set to the asset id, however this isn’t the case if you’re doing so from a script.

yes i did put the asset id and not the clothing one, but still it doesnt work.
but when i do everthing on the local script without the function and the remote event it works, but only i see the kit of the other player meanwhile that player doesnt see him with different clothes (maybe bc its for client)

Try changing this to a.OnServerEvent:Connect(GiveKit)

it doesn’t work

30 (cha)ract(ers