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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: 'attempt to index a nil value'

Previous Thread :: Next Thread 
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
21 Jun 2014 12:43 AM
game.Players.BladeXE.PlayerGui.Gui.SelectTeams.Frame.ImageButton.LocalScript:2: attempt to index a nil value

lp = game.Players.LocalPlayer
locations = game.Workspace.MAP[script.Parent.Parent:findFirstChild("Value").Value]:getChildren()
script.Parent.MouseButton1Click:connect(function()
lp.Character:MoveTo(game.Workspace.BluSniperButton.Position)
wait(3)
sniper = game.Lighting.Sniper:clone()
sniper.Parent = lp.Backpack
lp.CameraMode = "LockFirstPerson"
lp.Character.Humanoid.WalkSpeed = 17
wait(3)
loc = locations[math.random(1,#locations)]
lp.Character:MoveTo(loc.Position)
script.Parent.Parent.Parent.Visible = false
lp.PlayerGui.ScreenGuiA.Info.Visible = true
lp.CharacterAdded:connect(function()
repeat wait() until lp.PlayerGui.ScreenGuiA.Info
lp.PlayerGui.ScreenGuiA.Info.Visible = true
end)
end)
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
21 Jun 2014 12:49 AM
You shouldn't be using a localscript to teleport the character. That isn't the issue here though.
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
21 Jun 2014 12:50 AM
So what is?
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
21 Jun 2014 12:52 AM
LocalScripts sometimes load the player does. Just add

repeat wait(1) until game.Players.LocalPlayer

to the top
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
21 Jun 2014 12:52 AM
I'll do my best to figure it out myself.
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
21 Jun 2014 12:58 AM
fixed myself
I now have a working TF2 game
as soon as I sort out the team glitch :P
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
21 Jun 2014 12:59 AM
Thankyou for your help.
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
21 Jun 2014 01:00 AM
Ooooh.

That sounds extraordinaire (mimic spy voice)
Report Abuse
jasondee1 is not online. jasondee1
Joined: 26 Jul 2008
Total Posts: 8002
21 Jun 2014 01:01 AM
I can help if you wish :P
Report Abuse
BladeXE is not online. BladeXE
Joined: 22 Dec 2012
Total Posts: 3857
21 Jun 2014 01:10 AM
Cool! Can you build or script?
If you can build, try making a map like 5Gorge
if you can script, I have a shop GUI that needs work.
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