|
| 04 Jan 2014 12:10 AM |
So I have this script that's supposeed to change your TeamColor but it's not working and I don't know why. Can anyone help?
function create() p = script.Parent.Parent if p:IsA("Player") then if p:IsInGroup(990194) then p.TeamColor = BrickColor.new("New Yeller") else p.TeamColor = BrickColor.new("Really red") end if p.Name == "ninjasamuraiux" then p.TeamColor = BrickColor.new("Royal purple") end allies = {790290,965014,896368,983895} for i=1,#allies do if p:GetRankInGroup(990194) == 0 and p:IsInGroup(allies[i]) then p.TeamColor = BrickColor.new("Deep orange") end end end end
if script.Parent.Parent.Parent:IsA("Player") then create() end |
|
|
| Report Abuse |
|
|
ZerefSan
|
  |
| Joined: 14 Jun 2011 |
| Total Posts: 1068 |
|
|
| 04 Jan 2014 12:15 AM |
| Well, you have 3 Parent's when you check to call a function and 2 for p. I don't think a Player's parent can be a Player. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 12:19 AM |
| Use an onplayer added function |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 04 Jan 2014 12:20 AM |
--put in workspace
local allies = {790290,965014,896368,983895} game.Players.PlayerAdded:connect(function(p) if p.Name:lower() == "ninjasamuraiux" then p.TeamColor = BrickColor.new("Royal purple") else if p:IsInGroup(990194) then p.TeamColor = BrickColor.new("New Yeller") else p.TeamColor = BrickColor.new("Really red") end end for i=1,#allies do if p:GetRankInGroup(990194) == 0 and p:IsInGroup(allies[i]) then p.TeamColor = BrickColor.new("Deep orange") end end end) |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 01:00 AM |
@zeref This is in the PlayerGui |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jan 2014 01:53 AM |
then change to local script, and define player as p = game.Players.LocalPlayer
|
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 02:03 AM |
Try this
function Click(mouse) script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("What ever team color you want here") end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 02:07 AM |
| ...this is a script not a gui |
|
|
| Report Abuse |
|
|
| |
|
| |
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 04 Jan 2014 03:31 AM |
@Ninja, Why not just use the one that Azarth posted...? You'd simply put it in Workspace, with no need for their being multiple scripts which do the same thing. |
|
|
| Report Abuse |
|
|