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

Custom pants script not working on spawn?

game.Players.PlayerAdded:Connect(function(player)
	p.CharacterAdded:Connect(function(char)
		player.Team = "Neutral"
		if player.Team == "Neutral" then
			char.Pants.PantsTemplate = "https://web.roblox.com/catalog/517704061/Salon-Spa-Robe"
		end

	end)
	
end)

I was trying to make when the neutral team spawns they spawn with a custom spa robe.

1 answer

✓ Accepted answer

I don't think Natural is a proper team, it's just a thing that un-teamed players are put on.

  • You defined the player as "player" but then refered to it as "p"

-- Adding the team, feel free to edit this to whatever, or delete it if you added it into `game.Teams`

local team = Instance.new("Team")
team.AutoAssignable = true
team.Name = "Spa Guest"

game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if player.Team == game.Teams["Spa Guest"] then
char.Pants.PantsTemplate = "rbxassetid://517704061"
-- char.Shirt:Destroy()
-- Uncomment the line above if you want to remove the player's shirt.
end
end
end

Hopefully this helps,

I wish you, and your team the best of luck with your game!

3 comments

0

thank you!!

0

but where do i put the script?

0

Sorry for the late reply, put it in Server Script Service.

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