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