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: keep getting

Previous Thread :: Next Thread 
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 06:34 PM
Players.Player1.PlayerGui.main:130: attempt to index field 'Target' (a nil value)
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 06:35 PM
but it works... just breaks
Report Abuse
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
03 Jan 2017 06:36 PM
yeah, you may need to use pcall or something for this

.Target can be a tricky thing sometimes
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 06:44 PM
yeah but it ends messing up so like if i'm pointing or if i click the npc.. target ends up with error half the time

and messes up while its running the script in different parts with that error
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 06:51 PM
rs:connect(function()
if mouse.Target and mouse.Target~= nil and not down then
g.Image = ("")
g.ImageTransparency = 0
for _, v in pairs(Showable) do
ConfirmId(v)
if mouse.Target.Parent:IsA("Model")and mouse.Target.Parent.Name == v then -- errors but works


like this
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 06:57 PM
and


for _,x in pairs(Showable) do
if mouse.Target and mouse.Target.Parent.Name == x or mouse.Target.Name == x then -- right here
_G.PressDown()
break
else
print'Nil'


doesnt print nil


just does to index field 'Target' (a nil value)
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 07:11 PM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 07:38 PM
b
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 07:58 PM
b
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
03 Jan 2017 08:02 PM
if mouse.Target ~= nil then

Just check if it is nil.
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 08:06 PM
i do at the beginning
Report Abuse
GreedTaka is not online. GreedTaka
Joined: 12 Dec 2014
Total Posts: 1503
03 Jan 2017 09:26 PM
b
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