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

How do I make this team changer script a group only script?

deb = false function onMouseButton1Down() player = script.Parent.Parent.Parent.Parent.Parent if not deb then deb = true if not game:GetService("Teams"):findFirstChild("TGBE") then x = Instance.new("Team",game:GetService("Teams")) x.AutoAssignable = false x.TeamColor = BrickColor.new("Gold") x.AutoColorCharacters = false x.Name = "TGBE" end script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.New ("Really red") script.Parent.Parent.Parent.Parent.Parent.Neutral = false script.Parent.Parent.Parent.Parent.Parent:LoadCharacter() -- for weapon adds on team choosing its you can remove the -- -- bl = game.Lighting:findFirstChild("Basic Blade"):Clone() -- bl.Parent = player.StarterGear -- bl2 = game.Lighting:findFirstChild("Basic Blade"):Clone() -- bl2.Parent = player.Backpack wait (1) deb = false end end

script.Parent.MouseButton1Down:connect(onMouseButton1Down)

4 comments

0

Please help.

0

Format your code using Lua code block

0

And tab correctly, please.

0

Hi there. Format your code properly please.

1 answer

deb = false
function onMouseButton1Down() 
player = script.Parent.Parent.Parent.Parent.Parent 
if not deb then deb = true 
if not game:GetService("Teams"):findFirstChild("TGBE") then x = Instance.new("Team",game:GetService("Teams"))
x.AutoAssignable = false
x.TeamColor = BrickColor.new("Gold")
x.AutoColorCharacters = false
x.Name = "TGBE" 
end 

script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.New ("Really red") script.Parent.Parent.Parent.Parent.Parent.Neutral = false script.Parent.Parent.Parent.Parent.Parent:LoadCharacter() -- for weapon adds on team choosing its you can remove the
-- bl = game.Lighting:findFirstChild("Basic Blade"):Clone() 
-- bl.Parent = player.StarterGear -- bl2 = game.Lighting:findFirstChild("Basic Blade"):Clone()  --
-- bl2.Parent = player.Backpack wait (1) deb = false end end

script.Parent.MouseButton1Down:connect(onMouseButton1Down)

Here's some properly formatted code [potentially]

Also, check out this restricted door tutorial: http://wiki.roblox.com/index.php?title=Restricted_door Here's the code for group-only:

if player:IsInGroup(127081) then
	-- do stuff, yknow...
end

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