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
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 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 |
|
|
|
| 31 Jan 2015 12:20 PM |
| You should use Player.Character to get a character, don't search for it in Workspace. |
|
|
| Report Abuse |
|
|