FireFume
|
  |
| Joined: 03 Aug 2012 |
| Total Posts: 1654 |
|
|
| 13 Oct 2014 05:44 PM |
local player = game.Players.LocalPlayer local mouse = player:GetMouse()
mouse.Button1Down:connect(function() if mouse.Target == game.Workspace.FEEDME then script.Parent:Destroy() game.Workspace.FEEDME.FOOD.Value = game.Workspace.FEEDME.FOOD.Value - 1 end end) |
|
|
| Report Abuse |
|
|
FireFume
|
  |
| Joined: 03 Aug 2012 |
| Total Posts: 1654 |
|
| |
|
|
| 13 Oct 2014 05:51 PM |
try this if mouse.Target.Name == "FEEDME" then |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 13 Oct 2014 05:52 PM |
| Which is the part that isn't working? |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2014 05:53 PM |
also if
game.Workspace.FEEDME.FOOD.Value = game.Workspace.FEEDME.FOOD.Value - 1 is not working then try this
d = false local player = game.Players.LocalPlayer local mouse = player:GetMouse()
mouse.Button1Down:connect(function() if mouse.Target == game.Workspace.FEEDME then if d == false then d = true
game.Workspace.FEEDME.FOOD.Value = game.Workspace.FEEDME.FOOD.Value - 1 script.Parent:Destroy()
end d = false end) |
|
|
| Report Abuse |
|
|
FireFume
|
  |
| Joined: 03 Aug 2012 |
| Total Posts: 1654 |
|
|
| 13 Oct 2014 05:54 PM |
| nvm there is a error the mousebutton1down, this is a tool btw |
|
|
| Report Abuse |
|
|
FireFume
|
  |
| Joined: 03 Aug 2012 |
| Total Posts: 1654 |
|
| |
|
FireFume
|
  |
| Joined: 03 Aug 2012 |
| Total Posts: 1654 |
|
| |
|
FireFume
|
  |
| Joined: 03 Aug 2012 |
| Total Posts: 1654 |
|
| |
|
|
| 13 Oct 2014 06:16 PM |
Chill lol :)
local plr = game.Players.LocalPlayer local char = Workspace:WaitForChild(plr.Name) local plyr = game.Workspace:FindFirstChild(plr.Name) local mouse = plr:GetMouse() target= mouse.Target function onKeyDown(key) if mouse.Target.Name =="FEEDME" then game.Workspace.FEEDME.FOOD.Value = game.Workspace.FEEDME.FOOD.Value - 1 script.Parent:Destroy() end end mouse.KeyDown:connect(onKeyDown) |
|
|
| Report Abuse |
|
|
FireFume
|
  |
| Joined: 03 Aug 2012 |
| Total Posts: 1654 |
|
|
| 13 Oct 2014 06:27 PM |
| 19:31:00.461 - Players.Player1.Backpack.Taco.LocalScript:8: attempt to index field 'Target' (a nil value) |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2014 06:31 PM |
I had it in a normal script try switching from local to normal also you can add this if mouse.Target ~= nil then
|
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 13 Oct 2014 06:35 PM |
It's a tool!
Tool.Enabled:connect (function () -- fires whenever the left mouse button is clicked (tools only) if game.Players.LocalPlayer:GetMouse ().Target.Name == "IFORGOT" then --increase value end end) |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
| |
|