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 » Scripting Helpers
Home Search
 

Re: Problem

Previous Thread :: Next Thread 
ninjasamuraiux is not online. ninjasamuraiux
Joined: 23 Aug 2011
Total Posts: 5405
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 is not online. 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
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
04 Jan 2014 12:19 AM
Use an onplayer added function
Report Abuse
Azarth is not online. 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
ninjasamuraiux is not online. ninjasamuraiux
Joined: 23 Aug 2011
Total Posts: 5405
04 Jan 2014 01:00 AM
@zeref
This is in the PlayerGui
Report Abuse
ninjasamuraiux is not online. ninjasamuraiux
Joined: 23 Aug 2011
Total Posts: 5405
04 Jan 2014 01:38 AM
b1
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
04 Jan 2014 01:53 AM
then change to local script, and define player as p = game.Players.LocalPlayer
Report Abuse
leonides2012 is not online. leonides2012
Joined: 10 Apr 2012
Total Posts: 58
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
ninjasamuraiux is not online. ninjasamuraiux
Joined: 23 Aug 2011
Total Posts: 5405
04 Jan 2014 02:07 AM
...this is a script not a gui
Report Abuse
leonides2012 is not online. leonides2012
Joined: 10 Apr 2012
Total Posts: 58
04 Jan 2014 02:13 AM
Oh derp
Report Abuse
ninjasamuraiux is not online. ninjasamuraiux
Joined: 23 Aug 2011
Total Posts: 5405
04 Jan 2014 03:28 AM
b2
Report Abuse
DataStore is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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