I made this for my game.
This basically Sets You To Join as A Grey Robloxian. Change the colours to what you want. Then make a pad, so when you touch it, the clothes get cloned from Lighting or whatever.
game.Workspace.ChildAdded:connect(function(plr)
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(plr.Name)
if playerinplayers ~= nil then
playerinplayers.CanLoadCharacterAppearance = false
plr.Head.face.Texture = "rbxassetid://13033308"
local bodycolors = Instance.new("BodyColors", plr)
bodycolors.RightArmColor = BrickColor.new("Pastel brown")
bodycolors.LeftArmColor = BrickColor.new("Pastel brown")
bodycolors.LeftLegColor = BrickColor.new("Dark stone grey")
bodycolors.RightLegColor = BrickColor.new("Dark stone grey")
bodycolors.TorsoColor = BrickColor.new("Dark Stone grey")
bodycolors.HeadColor = BrickColor.new("Pastel brown")
end
end)
This is also another one. For This one, it more complex. You need to get shirts and pants from somewhere. I got mine off Uncopylocked Phantom Forces.
local team1 = game.Teams:findFirstChild("NameOfTeam")
local team2 = game.Teams:findFirstChild("NameOfTeam")
local t1shirt = game.Lighting:findFirstChild("NameOfTeam1Shirt")
local t2shirt = game.Lighting:findFirstChild("NameOfTeam2Shirt")
local t1pants = game.Lighting:findFirstChild("NameOfTeam1Pants")
local t2pants = game.Lighting:findFirstChild("nameOfTeam2Pants")
function onSpawn(player)
wait(1)
local clothing = player.Character:GetChildren()
for i = 1, #clothing do
if clothing[i].className == "Pants" or clothing[i].className == "Shirt" then
clothing[i]:remove()
end
end
if player.TeamColor == team1.TeamColor then
t1shirt:Clone().Parent = player.Character
t1pants:Clone().Parent = player.Character
end
if player.TeamColor == team2.TeamColor then
t2shirt:Clone().Parent = player.Character
t2pants:Clone().Parent = player.Character
end
end
function A(new)
new.Changed:connect(function(N) if N == "Character" then onSpawn(new) end end)
end
game.Players.ChildAdded:connect(A)
So Make it so there are spawn points that have AllowTeamChangeOnTouch = true. So When You Touch it, you become a part of that team.
Then, either make it so when u touch the spawn, u die, so you reset and spawn with the clothes you need
3 comments
Are you sure you made this? Do you ever call the function or define a debounce?
You Could SetCharacterAppearance = false
also, :findFirstChild() is deprecated, use :FindFirstChild() instead.