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: Attempt to call field 'Name' (a String Value)

Previous Thread :: Next Thread 
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
31 Jan 2015 11:04 AM
What is wrong with my script...?
minigames = game.Lighting.Minigames:GetChildren()
lobbyspawns2 = game.Lighting.LobbySpawns1:GetChildren()
minigames1 = game.Lighting.Games:GetChildren()
h = Instance.new("Hint", game.Workspace)
m = Instance.new("Message")
wait(0.1)
while true do
if game.Players.NumPlayers > 0 then
h.Text = "Choosing game..."
wait (3)
ranGame = math.random(1, #minigames) --THIS PART WORKS WITH RANGAME
gameChosen = minigames[ranGame]
h.Text = "Game chosen: " .. gameChosen.Name --NO PROBLEM WITH THIS NAME
gameChosenClone = gameChosen:Clone()
gameChosenClone.Parent = game.Workspace
wait (3)
for i,v in pairs(game.Players:GetPlayers()) do
name = v.Name
check = game.Workspace:FindFirstChild(name)
if check then
checkHumanoid = check:FindFirstChild("Humanoid")
if checkHumanoid then
m.Parent = game.Workspace
m.Text = "Choosing Game mode..."
wait(3)
ranMode = math.random(1, #minigames1) --OKAY LETS SEE HERE....
gameChosen1 = minigames1[ranMode] ---minigames1 = game.Lighting.Games:GetChildren()
if gameChosen1.Name == "Hardcore TDM" then --ERROR ATTEMPT TO CALL FIELD 'NAME'
m.Parent = game.Workspace
m.Text = "Game mode is Hardcore TDM"
wait(3)
v.Character:MoveTo(spawns[i].Position)
elseif gameChosen1.Name == "Hardcore FFA" then
m.Parent = game.Workspace
m.Text = "Game mode is Hardcore FFA"
wait(3)
v.Character:MoveTo(spawns[i].Position)
end
else
h.Text = "not enough players"
wait(3)
end

WHY WON'T NAME WORK ALL OF A SUDDEN???
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
31 Jan 2015 11:43 AM
anyone?
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
31 Jan 2015 11:44 AM
no idea.

if gameChosen1.Name == "Hardcore TDM" then --ERROR ATTEMPT TO CALL FIELD 'NAME' then --ERROR ATTEMPT TO CALL FIELD 'NAME'

But is there actually a Part or a StringValue called Name in all of your maps?

If it is a StringValue then try:

if gameChosen1.Name.Value == "Hardcore TDM" then

GL
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
31 Jan 2015 12:20 PM
You should use Player.Character to get a character, don't search for it in Workspace.
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