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: Script isn't working

Previous Thread :: Next Thread 
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:07 PM
PlayerNames = {"fourpapa1","AddName","AddName","AddName","AddName"}
for i,v in pairs(PlayerNames) do
if Player.Name:lower() == v:lower() then
Player.TeamColor = BrickColor.new("Really blue")
end

Supposed to change your team and the team is 'Really blue' already
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:10 PM
Help? Anyone?
I want to fix this fast so me and a friend can play this game now.
Report Abuse
sam8985 is not online. sam8985
Joined: 12 Nov 2011
Total Posts: 582
03 Aug 2013 10:11 PM
"Player is a nil value"
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
03 Aug 2013 10:12 PM
local PlayerNames = {"fourpapa1","AddName","AddName","AddName","AddName"}

function TeamChange()
for i, player in pairs(game.Players:GetPlayers()) do
for _,v in pairs(PlayerNames) do
if string.lower(player.Name) == string.lower(v) then
player.TeamColor = BrickColor.new("Really blue")
end
end
end
end
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:18 PM
@zach, didn't work.
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
03 Aug 2013 10:25 PM
Did you call the function?
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:30 PM
Huh?
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:36 PM
????
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
03 Aug 2013 10:38 PM
Free models don't belong in this forum.
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
03 Aug 2013 10:39 PM
@dra, that wasn't a free model.

And you have to call the function like this:

TeamChange()
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
03 Aug 2013 10:39 PM
To call a function, one needs to write the name of the function followed by an open and close parenthesis.

Ex: name()
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
03 Aug 2013 10:39 PM
Btw there is no function called.
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:40 PM
"Free models"

what model lol
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
03 Aug 2013 10:40 PM
@Zach It looks like one xD
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:41 PM
TeamChange() is on there already.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
03 Aug 2013 10:41 PM
On the bottom.
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:42 PM
I changed it to the one zach gave
Report Abuse
ZachBloxx is not online. ZachBloxx
Joined: 26 Jun 2013
Total Posts: 2833
03 Aug 2013 10:42 PM
The function TeamChange() is on the script, but then you have to call it some where so the code will execute.

local PlayerNames = {"fourpapa1","AddName","AddName","AddName","AddName"}

function TeamChange()
for i, player in pairs(game.Players:GetPlayers()) do
for _,v in pairs(PlayerNames) do
if string.lower(player.Name) == string.lower(v) then
player.TeamColor = BrickColor.new("Really blue")
end
end
end
end

TeamChange() -- this executes the code above.
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:47 PM
Uhh, not working.
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
03 Aug 2013 10:47 PM
permission = {"[Names go here]"}

function checkOkToLetIn(name)
for i = 1,#permission do
if (string.upper(name) == string.upper(permission[i])) then return true end
end
return false
end


admin = game.Teams:findFirstChild("[Team Name here]")

function onEntered(player)
if checkOkToLetIn(player.Name) then
player.TeamColor = admin.TeamColor
end
end


game.Players.PlayerAdded:connect(onEntered)
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:49 PM
Worked drah, thanks!
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
03 Aug 2013 10:49 PM
Sorry I replaced your whole script. it was just so improperly done xD
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
03 Aug 2013 10:50 PM
And Np.
Report Abuse
fourpapa1 is not online. fourpapa1
Joined: 16 Sep 2010
Total Posts: 2603
03 Aug 2013 10:52 PM
Also zach, thank you also for trying.
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
03 Aug 2013 10:52 PM
@Zach I'm sure TeamChange() Executes when the team is changed, not to execute it too change.
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