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
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
|
| 03 Jan 2017 06:35 PM |
| but it works... just breaks |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
|
| 03 Jan 2017 08:02 PM |
if mouse.Target ~= nil then
Just check if it is nil. |
|
|
| Report Abuse |
|
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|
GreedTaka
|
  |
| Joined: 12 Dec 2014 |
| Total Posts: 1503 |
|
| |
|