generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Spawn.

Previous Thread :: Next Thread 
cbhusker is not online. cbhusker
Joined: 07 Feb 2011
Total Posts: 517
24 Jan 2015 05:27 PM
Okay, so I have a spawnlocation that spawns the team "King", it's color is Very black. What I want it to be able to do is that you can join the team "AllowTeamChangeOnTouch", but ONLY when there is no one in the team at that moment.

So what I am basically saying, is you can only join the team if no one is in it.

I am willing to pay to get this script, Because I'm not very good at scripting, (at all), so yeah, Possibly pay if one of you people can make it for me.

- Thanks, Cbhusker
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
24 Jan 2015 05:31 PM
Payment is not necessary. Simply put this script in the spawn, but make sure AllowTeamChangeOnTouch is false.

col = BrickColor.new(1003);

function _(h)
local c = pcall(function() return h.Parent.Humanoid end);
if (c) then
local n = 0;
for a,b in next,game.Players:getPlayers() do
if(b.TeamColor==col) then n=n+1 end;
end;
if not (n>1) then game.Players[h.Parent.Name].TeamColor = col end;
end;
end;

script.Parent.Touched(_);
Report Abuse
EliteDerper is not online. EliteDerper
Joined: 05 Feb 2012
Total Posts: 2288
24 Jan 2015 05:32 PM
Here it is for free
Btw turn AllowTeamChangeOnTouch off
And put this script inside the spawnlocation
Wrote this from scratch so tell me if there are any bugs.



function getKing()
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == game.Teams.King.TeamColor then
return true
end
end
end
script.Parent.Touched:connect(function(part)
if part and part.Parent and game.Players:GetPlayerFromCharacter(part.Parent) then
if not getKing() then
game.Players:GetPlayerFromCharacter(part.Parent).TeamColor = game.Teams.King.TeamColor
end
end
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image