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: A name that works for all payers in quotations?

Previous Thread :: Next Thread 
zub74 is not online. zub74
Joined: 13 Sep 2008
Total Posts: 489
25 Jul 2013 08:28 PM
For example,

BadgeId = 115330646

game.Players.PlayerAdded:connect(function(p)
if game:GetService("BadgeService"):UserHasBadge(p.userId, BadgeId) then
Humanoid.Parent.Name = "Alpha Tester (Player)"
end

But it doesn't work. It actually doesn't rename them at all. D:

But if it did, would I do Name= "Alpha Tester" Player, or what?
Report Abuse
zub74 is not online. zub74
Joined: 13 Sep 2008
Total Posts: 489
25 Jul 2013 08:40 PM
Bump.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
25 Jul 2013 08:42 PM
Lua doesn't have the ability to include variables directly in string literals.
You have to concatenate [put strings together, e.g, "cat" and "dog" concatenated is "catdog"] (.. is the concatenation operator) to the literal the player's name, as some variable / property.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
25 Jul 2013 08:45 PM
("Alpha Tester $p"):gsub("$p", p.Name)

?
Report Abuse
zub74 is not online. zub74
Joined: 13 Sep 2008
Total Posts: 489
25 Jul 2013 08:56 PM
For example,

a= (player's name) <--- not actual value..

print ("Alpha Tester" .. a)


Would print Alpha Tester Zub74, Derp, Nubscrub, etc? (Assuming the rest of the script was in place)
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
25 Jul 2013 08:58 PM
Don't put spaces in between.

"Alpha Tester"..a

Leave the periods touching the variable and the quotation marks.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
25 Jul 2013 08:59 PM
...why would you take out the spaces? That's a terrible suggestion.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
25 Jul 2013 08:59 PM
...unless its a number, in which you must never do that...

Why?
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
25 Jul 2013 09:01 PM
@Blue

I don't know what I'm doing anymore ._. Just ignore me... I'll be going back to the home now.
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