#Need help with random name generator
87 messages · Page 1 of 1 (latest)
you would have a table with names
and another table with last names
so 2 tables right
every time the player joins get a random value from from the names table
and another random value from the last names table
apply those values in either an attribute, or an object value, whatever you decided to use for the player name and last name storage 🙂
that's literally it
@manic bloom Currently I have 2 folders in server storage, in them are 50 first name values and 50 last name values already named
Did i do it right
I mean yes
I would have not done that but you can do exactly the same thing
sorry i dont scro[t
it's fine
and theres no tutorials
this is all i have idk anything
local serverStorage = game:GetService("ServerStorage")
local FirstNamesFold = serverStorage.FirstNames
local LastNamesFold = serverStorage.LastNames
local FirstNameRand = math.random(1,50)
local LastNameRand = math.random(1,50)
local FirstName = FirstNamesFold:FindFirstChild(FirstNameRand).Value
local LastName = LastNamesFold:FindFirstChild(LastNameRand).Value
local Player = game.Players.LocalPlayer
Player.Parent = workspace
Player.Name = FirstName.." "..LastName
end
okay so 2 folders right?
almost
that'll error
local FirstName = FirstNamesFold:FindFirstChild(FirstNameRand).Value
local LastName = LastNamesFold:FindFirstChild(LastNameRand).Value
see this? FindFirstChild takes a string
you are passing a number
so what you want to do is
local FirstName = FirstNamesFold:GetChildren()[FirstName].Value
local LastName = LastNamesFold:GetChildren()[LastName].Value
GetChildren will return an array
and you can index to an array with bracketsd []
ok
wait
only that minor thing
I don't get it
see the variable names 🙂
ohhh
yah
should i remove end?
;-;
its red
oh
local serverStorage = game:GetService("ServerStorage")
local FirstNamesFold = serverStorage.FirstNames
local LastNamesFold = serverStorage.LastNames
local FirstNameRand = math.random(1,50)
local LastNameRand = math.random(1,50)
local FirstName = FirstNamesFold:FindFirstChild(FirstNameRand).Value
local LastName = LastNamesFold:FindFirstChild(LastNameRand).Value
local FirstName = FirstNamesFold:GetChildren()[FirstName].Value
local LastName = LastNamesFold:GetChildren()[LastName].Value
local Player = game.Players.LocalPlayer
Player.Parent = workspace
Player.Name = FirstName.." "..LastName
end
good?
uh
why do you have 2 pairs?
o
local FirstName = FirstNamesFold:FindFirstChild(FirstNameRand).Value
local LastName = LastNamesFold:FindFirstChild(LastNameRand).Value
local FirstName = FirstNamesFold:GetChildren()[FirstName].Value
local LastName = LastNamesFold:GetChildren()[LastName].Value
oop
lol
local serverStorage = game:GetService("ServerStorage")
local FirstNamesFold = serverStorage.FirstNames
local LastNamesFold = serverStorage.LastNames
local FirstNameRand = math.random(1,50)
local LastNameRand = math.random(1,50)
local FirstName = FirstNamesFold:GetChildren()[FirstName].Value
local LastName = LastNamesFold:GetChildren()[LastName].Value
local Player = game.Players.LocalPlayer
Player.Parent = workspace
Player.Name = FirstName.." "..LastName
end
I just told you to replace FindFirstChild with what I gave you
wrong again
i did
ok
pass FirstNameRand
just use a table of the name
** You are now Level 12! **
s