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 » Scripters
Home Search
 

Re: Name Chooser

Previous Thread :: Next Thread 
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 08:03 PM
Ok so in my game, you get to choose a name. However, there are preset names that you have to choose from that you can scroll through. How do I allow you to scroll through them without a bunch of if statements telling which name comes after which?

Sorry if this is a bit vague, this is the best way I could explain it.
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
31 Jan 2015 08:07 PM
do you mean on a Gui?
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 08:08 PM
Yeah, sorry.
Report Abuse
DoAndDoOver is not online. DoAndDoOver
Joined: 06 Sep 2014
Total Posts: 628
31 Jan 2015 08:09 PM
You could make a table full of the names.

local names = {"Bob", "Janet", "Harry", "Michelle"}
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 08:11 PM
But how would I use them from there?
(I have actually never used a table before)
Report Abuse
DoAndDoOver is not online. DoAndDoOver
Joined: 06 Sep 2014
Total Posts: 628
31 Jan 2015 08:13 PM
Well, post your script and show me what you are working with, and I will try to adapt it with a table?
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 08:16 PM
I haven't written anything yet... Well at least nothing for the name changing bit.
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
31 Jan 2015 08:20 PM
local names = {"Tom", "Michelle", "Ryan"}

for i = 1,3 do
something.Text = names[i]
end

Not going to do the whole script for you without you working on it, but this is the general idea for what you want.
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 08:22 PM
That would work, but the list of names is an image and I was planning on offsetting the image each time a player clicked on an up or down arrow. That part I can do, but I just don't know how to let the script know it changed without a bunch if statements saying which name goes to what.

(The reason its an image is because I wanted my own custom piratey font)
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 08:23 PM
If you could just tell me how without scripting it FOR me that would be great :P
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
31 Jan 2015 08:32 PM
Use a scrollingframe.
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 08:38 PM
But then how would the game know which name you chose?
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 08:50 PM
Well whatever, the list of names I made was so long that ROBLOX lost all the resolution.
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
31 Jan 2015 09:11 PM
A ScrollingFrame works the same as a frame, have you not used a frame before?
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
31 Jan 2015 09:42 PM
Yes but a ScrollingFrame scrolls via user input.
Report Abuse
SaluteMeScrub is not online. SaluteMeScrub
Joined: 28 Dec 2013
Total Posts: 380
01 Feb 2015 04:14 PM
What do you want then?
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
01 Feb 2015 06:31 PM
There are two arrows. One pointing up, one pointing down. The up arrow goes back up through the list (Z to A), and the down arrow goes down through the list of names (A-Z). Each time you click either of the arrows, a new name shows up depending on the direction of the arrow you clicked.

So lets say there are four names:

Aaron, Abraham, Adam, and Adrian.

If you click the up arrow and the name "Adam" is being displayed, the new name that should be displayed is "Abraham". If the name "Adrian" is being displayed and you click the down arrow, the new name that should be displayed is "Aaron".
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
01 Feb 2015 06:47 PM
Anyyyyone?
Report Abuse
DeathsLASTwords is not online. DeathsLASTwords
Joined: 28 Jan 2012
Total Posts: 2701
01 Feb 2015 06:48 PM
What are the names for?
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
01 Feb 2015 06:51 PM
Choosing a name for your character.
Report Abuse
MassiveFreak is not online. MassiveFreak
Joined: 03 Jan 2010
Total Posts: 48
01 Feb 2015 07:03 PM
Hey there,

So I read through this, and I'd recommend doing this:

1) Rename each ImageButton to the names you want them.
2) Put a simple script in each of the buttons to check when a user has clicked, and then renames the player.

In this following script I am going to assume that you have a label displayed over the player's head to use as their name label. If this is not the case, oh well. You've gotta learn on your own, this is only to help clear things up. Also, this is going to be as simple as I can get:

script.Parent.MouseButton1Click:connect(function()
Player = game.Players.LocalPlayer
Player.PlayerGui.ScreenGui.CharacterName.Text = "YourNameHere"
end)
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
01 Feb 2015 08:53 PM
I actually just thought of a much more effective and easy way of doing it but would be too hard to explain here.
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
01 Feb 2015 08:54 PM
One step closer to getting this game released on time! :D
Report Abuse
Rocky28447 is not online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
01 Feb 2015 08:56 PM
I basically made a bot that made a whole bunch of string values for me containing the names and every time someone hits the up arrow it will just do currentName - 1:

num = 1

for i = 1, #maleNames do
newString = Instance.new("StringValue",game.Workspace.MaleNames)
newString.Name = num
newString.Value = maleNames[i]
num = num + 1
end

So yeah thats pretty much how I will be going about this
Report Abuse
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
01 Feb 2015 09:11 PM
local Names = {"Name","SampleText","Shrek"}

blah.MouseButton1Down:connect(function()
avalue.Value = avalue.Value + 1
end)


avalue.Changed:connect(function(thing)
textlabel.Text = "Name: "..Names[avalue.Value]
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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