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: Please fix

Previous Thread :: Next Thread 
OpenedWattle is not online. OpenedWattle
Joined: 24 Jan 2013
Total Posts: 66
20 Jul 2013 09:24 AM
owners = {"OpenedWattle"}

function isPlayerOwner(name)
for i,v in pairs (owners) do
if newPlayer.Name == v then
return true
end
end
end


function playerJoined(newPlayer)
if isPlayerOwner(newPlayer.Name) then
newPlayer.TeamColor = BrickColor.new("Bright blue")
end
end


game.Players.PlayerAdded:connect(isPlayerOwner)
Report Abuse
CODsniperkid is not online. CODsniperkid
Joined: 17 Jul 2009
Total Posts: 872
20 Jul 2013 09:34 AM
What exactly is the goal of this script? What is the error saying and on which line? Give us more information for us to be able to help you.

◄◄Join TriF Corporation for Building, Scripting, Designing, and more! http://www.roblox.com/My/Groups.aspx?gid=910626 ►►
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
20 Jul 2013 09:59 AM
@COD
You can easily see what this is supposed to do by looking. It wasn't an overly complicated script to read. .-.

@OP
You called the wrong function with your connection line.
Also, I enjoy returning false when it's not true. After the loop, you can do this.

owners = {"OpenedWattle"}

function isPlayerOwner(name)
for i,v in pairs(owners) do
if newPlayer.Name == v then
return true
end
end
return false
end


function playerJoined(newPlayer)
if isPlayerOwner(newPlayer.Name) then
newPlayer.TeamColor = BrickColor.new("Bright blue")
end
end


game.Players.PlayerAdded:connect(playerJoined)
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
20 Jul 2013 10:00 AM
Oi. I didn't catch that. xD
Change 'newPlayer.Name' in the isPlayerOwner function to 'name', which you set as the parameter.

if newPlayer.Name == v then
to
if name == v then
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