cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
|
| 25 Jan 2009 01:08 PM |
function onButton1Down(mouse) hit = mouse.Target local debounce = false
if hit == nil then return end if (hit.Position - game.Players.LocalPlayer.Character.BlueTroops.Head.Position).magnitude < 7 then if debounce == false then local check = hit.Parent:findFirstChild("Health") if check == nil then return end debounce = true Check.Value = Check.Value - script.Parent.Parent.Parent.Character.BlueTroops.Damage.Value script.Parent.Parent[".:Main:."].XP.Value = script.Parent.Parent[".:Main:."].XP.Value + 2 script.Parent.Parent[".:Main:."].Points.Value = script.Parent.Parent[".:Main:."].Points.Value + 5 script.Parent.Name = ".:Attack :." wait(5) debounce = false script.Parent.Name = ".:Attack:." end end end
function onSelected(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|
Hopslop
|
  |
| Joined: 11 May 2008 |
| Total Posts: 3795 |
|
|
| 25 Jan 2009 01:11 PM |
This should work:
function onButton1Down(mouse) hit = mouse.Target local debounce = true
if hit == nil then return end if (hit.Position - game.Players.LocalPlayer.Character.BlueTroops.Head.Position).magnitude < 7 then if debounce == false then local check = hit.Parent:findFirstChild("Health") if check == nil then return end debounce = true Check.Value = Check.Value - script.Parent.Parent.Parent.Character.BlueTroops.Damage.Value script.Parent.Parent[".:Main:."].XP.Value = script.Parent.Parent[".:Main:."].XP.Value + 2 script.Parent.Parent[".:Main:."].Points.Value = script.Parent.Parent[".:Main:."].Points.Value + 5 script.Parent.Name = ".:Attack :." wait(5) debounce = false script.Parent.Name = ".:Attack:." end end end end
function onSelected(mouse) mouse.Button1Down:connect(function() onButton2Down(mouse) end) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|
| |
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
|
| 25 Jan 2009 01:13 PM |
| No i didnt if you look it says "return end" |
|
|
| Report Abuse |
|
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
| |
|
|
| 25 Jan 2009 01:18 PM |
j00 needed to end the function.
you ended all the if's |
|
|
| Report Abuse |
|
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
|
| 25 Jan 2009 01:19 PM |
| I have ended the function along with the 2 ifs which needed an end. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2009 01:21 PM |
level, you're wrong. Just face it. ^_^
local debounce = false function onButton1Down(mouse) hit = mouse.Target
if hit == nil then return end if (hit.Position - game.Players.LocalPlayer.Character.BlueTroops.Head.Position).magnitude < 7 then if debounce == false then debounce = true local check = hit.Parent:findFirstChild("Health") if check == nil then return end debounce = true Check.Value = Check.Value - script.Parent.Parent.Parent.Character.BlueTroops.Damage.Value script.Parent.Parent[".:Main:."].XP.Value = script.Parent.Parent[".:Main:."].XP.Value + 2 script.Parent.Parent[".:Main:."].Points.Value = script.Parent.Parent[".:Main:."].Points.Value + 5 script.Parent.Name = ".:Attack :." wait(5) debounce = false script.Parent.Name = ".:Attack:." end end end
function onSelected(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Selected:connect(onSelected)
Try that. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2009 01:22 PM |
grrr i only saw 1 return end...
I didn't fully read it, what was wrong? |
|
|
| Report Abuse |
|
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
|
| 25 Jan 2009 01:22 PM |
| Ty agent ill try now. Its ok level. |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2009 01:22 PM |
I have no clue. >_>
I do know he was setting debounce to false every time he clicked. I fixed that, though. |
|
|
| Report Abuse |
|
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
| |
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
|
| 25 Jan 2009 01:31 PM |
| For such a simple hopperbin its really hard to fix -__-" |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2009 01:31 PM |
local debounce = false function onButton1Down(mouse) hit = mouse.Target
if hit == nil then return end if (hit.Position - game.Players.LocalPlayer.Character.BlueTroops.Head.Position).magnitude < 7 then if debounce == false then debounce = true local Check = hit.Parent:findFirstChild("Health") if Check == nil then return end debounce = true Check.Value = Check.Value - script.Parent.Parent.Parent.Character.BlueTroops.Damage.Value script.Parent.Parent[".:Main:."].XP.Value = script.Parent.Parent[".:Main:."].XP.Value + 2 script.Parent.Parent[".:Main:."].Points.Value = script.Parent.Parent[".:Main:."].Points.Value + 5 script.Parent.Name = ".:Attack :." wait(5) debounce = false script.Parent.Name = ".:Attack:." end end end
function onSelected(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) end
script.Parent.Selected:connect(onSelected) |
|
|
| Report Abuse |
|
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
|
| 25 Jan 2009 01:41 PM |
| Would it maske any difference if the thing you are clicking is in someones character? |
|
|
| Report Abuse |
|
|
bow5
|
  |
| Joined: 09 Nov 2007 |
| Total Posts: 2077 |
|
|
| 25 Jan 2009 01:51 PM |
| Ajent that one dident work ethier I was testing it with cymru |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2009 01:52 PM |
| Are you using a LocalScript? |
|
|
| Report Abuse |
|
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
| |
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
| |
|
|
| 25 Jan 2009 02:24 PM |
| If you need my help, I need you to make everything a free model, including the script that put the BlueTroops, and everything in the player. I need all scripts, and all models in a free model. If you don't care for my help, then nvm. |
|
|
| Report Abuse |
|
|
cymru792
|
  |
| Joined: 28 Jan 2008 |
| Total Posts: 2803 |
|
|
| 25 Jan 2009 02:26 PM |
| Ok wait there then roberto |
|
|
| Report Abuse |
|
|