|
I am trying to make a game with a spectating team. I only want one team to have the spectate button but, I can't figure out how to make it so the spectate option is only for one team. Can anyone help? |
|
connor954Join Date: 2008-07-24 Post Count: 947 |
Are you trying with a local script? |
|
|
connor954Join Date: 2008-07-24 Post Count: 947 |
Oh wait, sorry. Didn't read your whole post. |
|
TynexxJoin Date: 2012-07-11 Post Count: 1559 |
for i,v in pairs(game.Players:GetPlayer()) do
if v.TeamColor == BrickColor.new("Colorhere") then
local gui = game.ServerStorage.Spectate:Clone()
gui.Parent = v.PlayerGui
end
end
Might work
~Tynexx |
|
|
Script didn't work Tynexx. I'm trying to make it so the spectate button only works for one team. |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
Put the gui inside this script and name it "Spec"
function newPlayer(Player)
Player.CharacterAdded:connect(function(_)
if Player.TeamColor == BrickColor.new("Bright blue") then
script.Spec:Clone() = Player:WaitForChild("PlayerGui")
end
end)
end
Game.Players.PlayerAdded:connect(newPlayer) |
|
|
@128GB that script didn't work. Here is the GUI i'm using. http://www.roblox.com/spectate-GUI-item?id=107703223 |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
Where did you put the script and did you change the .TeamColor == BrickColor.new("Bright blue") part to the color of your team? |
|
|
Yes I re-changed the color name. I put it in this GUI: http://www.roblox.com/spectate-GUI-item?id=132497677 |
|
|
Okay, so I am trying to make it so the spectate button only appears for one team. I just can't figure this out. |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
Just check what team they are on before running the specate code |
|