Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

can you help me change the clothes ?

hello, i am a beginner of scripting, but i don't know how to change cloth of the player, i want to put the line under player:LoadCharacter() (the value of the player is... player x) )

script

function remote.OnServerInvoke(player, TeamName)
    player.TeamColor = BrickColor.new(TeamName) -- Team Change
if player.TeamColor == BrickColor.new("New Yeller") then -- Searcher LVL 2
			player:LoadCharacter()

			

thanks you !

2 comments

0

The question sounds like you need help changing your clothes* :P | Be more specific in the title.

0

XD , sorry for that

1 answer

✓ Accepted answer
local function ChangeClothes(char, shirtid, pantsid)
	local shirt = char:FindFirstChildOfClass"Shirt" or Instance.new("Shirt", char)
	local pants = char:FindFirstChildOfClass"Pants" or Instance.new("Pants", char)
	shirt.ShirtTemplate = shirtid
	pants.PantsTemplate = pantsid
end

remote.OnServerInvoke = function(player, TeamName)
	player.TeamColor = BrickColor.new(TeamName)
	if TeamName == "New Yeller" then
		player:LoadCharacter()
		local char = player.Character or player.CharacterAdded:Wait()
		ChangeClothes(char, 263683661, 317425374) --replace with your desired ids
	end
end

Btw you should add additional security measures to ensure that exploiters can't use your remote function to assign themselves into any team they want.

2 comments

0

Thanks you so much ! its working :D

0

and... small question , if i want remove all hats and add a new one , how i can do this ?

This discussion is preserved as it was. New answers, comments, and votes are closed.