Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 04 May 2013 08:27 PM |
Or so the output says.
Line ten:
if Mouse.Target.Name == PickupableItems[i] then
Line that defines Target (Mouse, rather):
local Mouse = game.Players.LocalPlayer:GetMouse()
Am I missing something? |
|
|
| Report Abuse |
|
|
|
| 04 May 2013 08:28 PM |
| if (Mouse.Target) and (Mouse.Target.Name == PickupableItems[i]) then |
|
|
| Report Abuse |
|
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 04 May 2013 08:34 PM |
Ah, thanks. Can you explain why this doesn't work? It doesn't give output, and doesn't print what I want it to print either:
function KeyPressed(key) if key == "t" then print ("t lololol") for i = 1,#PickupableItems do if Mouse.Target.Name == PickupableItems[i] then Mouse.target:Remove() end end end end Mouse.KeyDown:connect(KeyPressed)
Note that this is not the full code, but just a snippet of it. It is in a hopperbin, and is part of the upper code I posted earlier. |
|
|
| Report Abuse |
|
|
|
| 04 May 2013 08:35 PM |
| You haven't implemented Cody's suggestion, that's why it doesn't work. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 04 May 2013 08:38 PM |
| Yes I did?? That's why I said thanks.. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
|
| 04 May 2013 08:57 PM |
| "Mouse.Target and Mouse.Target.Name == PickupableItems[i]" appears nowhere in your code. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 04 May 2013 09:04 PM |
| "Note that this is not the full code, but just a snippet of it. It is in a hopperbin, and is part of the upper code I posted earlier." |
|
|
| Report Abuse |
|
|
|
| 04 May 2013 09:09 PM |
| If you want to be snappy with me, I'll stop helping you. The fact that you're not willing to put the fix in the code means that you can't fix it. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
|
| 04 May 2013 09:12 PM |
| You're not really wanting to help, are you? I already told you that I implemented the code fix earlier. This is a later part of the code. My first problem is solved. Now I'm asking for help for the second fix. I shall post the full code if you want it, but I have made the fix Cody provided. This is the same script, just later on. If you really need proof, I'll give you it. I'm not trying to be snappy; you're just not reading what I'm posting.. |
|
|
| Report Abuse |
|
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
Zkiller11
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 2914 |
|
| |
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 06 May 2013 11:19 AM |
Before referencing target add, if not mouse.Target then return end The issue is that you are not always moused over an object. |
|
|
| Report Abuse |
|
|
|
| 06 May 2013 11:35 AM |
The Keydown/press should look like:
Key = key:lower() if key == "LETTERPRESSEDINLOWERCASE" then
NOTE: THIS IS WITHOUT THE HOPPERBIN |
|
|
| Report Abuse |
|
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 06 May 2013 11:39 AM |
| It also doesn't help that Target is in the wrong case on the line to remove it. Target is Target not target. |
|
|
| Report Abuse |
|
|
|
| 06 May 2013 11:40 AM |
| Zkiller I hope you know we rarely use hopperbin's now. |
|
|
| Report Abuse |
|
|
|
| 06 May 2013 11:48 AM |
| @Custard - That's not true. I happen to use them alot. |
|
|
| Report Abuse |
|
|