#TEAMCLOTHES PROBLEM

12 messages · Page 1 of 1 (latest)

violet lion
#

The team switch works but when u switch the team u cant get the clothes even tho u should here is the script error and some ss:

server script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Handler = ReplicatedStorage.Handler
local Teams = game:GetService("Teams")

local function equipClothes(Character, Team)
if Team == "VIP" then
Character.Shirt:Destroy()
Character.Pants:Destroy()
local shirt = ReplicatedStorage.Prisoner.Shirt:Clone()
shirt.Parent = Character
local pants = ReplicatedStorage.Prisoner.Pants:Clone()
shirt.Parent = Character
elseif Team == "Players" then
Character.Shirt:Destroy()
Character.Pants:Destroy()
local shirt = ReplicatedStorage.Players.Shirt:Clone()
shirt.Parent = Character
local pants = ReplicatedStorage.Players.Pants:Clone()
shirt.Parent = Character
end
end

Players.PlayerAdded:Connect(function(Player)
Players.CharacterAdded:Connect(function(Character)
if Player.Team.Name == "VIP" then
repeat task.wait() until Character.shirt and Character.pants
equipClothes(Character, "VIP")
elseif Player.Team.Name == "Players" then
repeat task.wait() until Character.shirt and Character.pants
equipClothes(Character, "Players")
end

end)
end)

Handler.OnServerEvent:Connect(function(Player, Team)
Player.Team = Teams[Team]
equipClothes(Player.Character, Teams[Team])
Player:LoadCharacter()
end)

error:

CharacterAdded is not a valid member of Players "Players"

ss from the studio:

vernal orbit
#

maybe try changing the clothing ids instead?

violet lion
#

i think its not the problem

vernal orbit
#

oh i didnt see the "CharacterAdded is not a valid member" error

violet lion
#

SOLVED LMAO IT IS

#

IT WAS ONLY CUZ OF THE CAPITAL LETTER IN ONE SCRIPT

#

XDDDD

#

AINT NO WAY

vernal orbit
#

oh lol

#

where

#

oh you mean "shirt" and "pants"