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

How would I make this available for only 1 team?

I got werewolves vs Humans. Werewolves spawn with a morph, humans don't. This script, it makes EVERYONE spawn with the morph. How would I make it only so the Bright blue team would?

game.Players.PlayerAdded:connect(function(player)
	if game.Players.LocalPlayer.TeamColor == BrickColor.new('Bright blue') then
	while not player.Character do wait() end
	local Ch=player.Character


local g = script.Leg1:clone()
		g.Parent = Ch
		local C = g:GetChildren()
		for i=1, #C do
			if C[i].className == "Part" then
				local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
			end
				local Y = Instance.new("Weld")
				Y.Part0 = Ch["Left Leg"]
				Y.Part1 = g.Middle
				Y.C0 = CFrame.new(0, 0, 0)
				Y.Parent = Y.Part0
		end

		local h = g:GetChildren()
		for i = 1, # h do
			if h[i].className == "Part" then
				h[i].Anchored = false
				h[i].CanCollide = false
			end
		end
	







	end
	end)

1 comment

0

What you could do is add a bool value into certain players, so when a player is added they get a true or false value. you can then make it so that depending on their team color on spawn, the value turns true or false, therefore (e.g) if the value is true, make the morph. (Theoretically)

1 answer

Hi..(this has not been tested and i cant test it right now) So i dont think you need lines 3 and 4 and Line 2 is not 100 hundred percent correct so I will teach u.

game.Players.PlayerAdded:connect(function(player)
if game.Players.LocalPlayer.TeamColor == BrickColor.new('Bright blue') then --I changed it right here so it knows to do it
-- Then right under it add lines 7 and down.


Like i said it should work but i havent had a chance to test it. Let me know if this worked:)

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