|
| 22 Dec 2011 03:36 PM |
This script is supposed to let people in the HRs to be in the "High Ranks" team. If they're not on the list, they are on the "Regular People".
HRs = {"KnightmareXD", "OtherHR"} HRTeam = game.Teams:findFirstChild("High Ranks") RegTeam = game.Teams:findFirstChild("Regular People")
function Entered(plyr) if (plyr.Name == HRs) then plyr.TeamColor = HRTeam.TeamColor else plyr.TeamColor = RegTeam.TeamColor end end
game.Players.ChildAdded:connect(Entered) |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 22 Dec 2011 03:39 PM |
HRs = {KnightmareXD = true, OtherHR = true} HRTeam = game.Teams:findFirstChild("High Ranks") RegTeam = game.Teams:findFirstChild("Regular People")
function Entered(plyr) plyr.TeamColor = (Hrs[plyr.Name]) and HRTeam.TeamColor or RegTeam.TeamColor end
game.Players.PlayerAdded:connect(Entered)
Maybe? |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 22 Dec 2011 03:42 PM |
local HRs = {"KnightmareXD", "OtherHR"} HRTeam = game.Teams:findFirstChild("High Ranks") RegTeam = game.Teams:findFirstChild("Regular People")
function makeTrue(table) for i,c in pairs(table) do table[c]=true end end
makeTrue(HRs)
game.Players.PlayerAdded:connect(function(plr) if HRs[plr.Name] then plr.TeamColor = HRTeam.TeamColor else plr.TeamColor = RegTeam.TeamColor end end) <'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2011 03:42 PM |
| Hm, it's still spawning me in the "High Ranks". What does the = true in a table mean? |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 22 Dec 2011 03:43 PM |
local HRs = {"KnightmareXD", "OtherHR"} HRTeam = game.Teams:findFirstChild("High Ranks") RegTeam = game.Teams:findFirstChild("Regular People")
function makeTrue(table) for i,c in pairs(table) do table[c]=true end end
makeTrue(HRs)
game.Players.PlayerAdded:connect(function(plr) plr.TeamColor=HRs[plr.Name] and HRTeam.TeamColor or plr.TeamColor = RegTeam.TeamColor end)
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 22 Dec 2011 03:43 PM |
@Spec, shouldn't it be local t={["blah"]=true,["blah2"]=true}) :o?
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 22 Dec 2011 03:47 PM |
t = {Hello = "World!"} print(t["Hello"])
>World!
Hmm... |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2011 03:47 PM |
@nate Your first script works, but I wasn't spawned in the HRs spawn location. :/ |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 22 Dec 2011 03:49 PM |
Try this one, I made a typo; HRs = {KnightmareXD = true, OtherHR = true} HRTeam = game.Teams:findFirstChild("High Ranks") RegTeam = game.Teams:findFirstChild("Regular People")
function Entered(plyr) plyr.TeamColor = (HRs[plyr.Name]) and HRTeam.TeamColor or RegTeam.TeamColor plyr.CharacterAdded:wait() plyr.Character:BreakJoints() end
game.Players.PlayerAdded:connect(Entered) |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 22 Dec 2011 03:49 PM |
@Spectrumw Never knew that worked :o.
@OP, Then that's a problem with your spawns.
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|