dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 10:56 AM |
function onTouched(hit) if debounce = true then return end if debounce = false then debounce = true if hit.Parent.Humanoid.Health = 0 then Tool.Parent.Walkspeed = Tool.Parent.Walkspeed + 0.5 wait(1) debounce = false end
script.Parent.Touched:connect(onTouched)
Output: Workspace.MoonsheathStand.Moonsheath.Walkspeed Adder:2: 'then' expected near '='
I don't know which "=" it is needed at. The script is inside the sword itself, not the handle. Something tells me that that's the problem. |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 25 Aug 2011 10:58 AM |
| You Output means you need 2 ==. |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 10:59 AM |
I was never really used ot debounce, so...
I still have the same output. |
|
|
| Report Abuse |
|
|
bloob827
|
  |
| Joined: 01 Aug 2010 |
| Total Posts: 6867 |
|
|
| 25 Aug 2011 11:01 AM |
| the third if statement needs a 'then' |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 25 Aug 2011 11:02 AM |
"=", Sets a value "==", Checks a value. |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:04 AM |
This doesn't seem to be working... I never used debounce or the output...
3:) |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:07 AM |
| I seem to have it fixed, but now I have to put it into the handle. |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:08 AM |
And it still didn't work. Let me try using output to find the problem... |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:10 AM |
Here's what I have so far.
function onTouched(hit) if debounce == true then return end if debounce == false then debounce = true if hit.Parent.Humanoid.Health == 0 then Tool.Parent.Walkspeed = Tool.Parent.Walkspeed + 0.5 wait(1) debounce = false end end end
script.Parent.Touched:connect(onTouched)
I'm not getting any output, and my walkspeed isn't changing. |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:11 AM |
*facepalm*
That mistake was os easy, even a cavemman could fix it.
function onTouched(hit) if debounce == true then return end if debounce == false then debounce = true if hit.Parent.Humanoid.Health == 0 then Tool.Parent.Humanoid.Walkspeed = Tool.Parent.Humanoid.Walkspeed + 0.5 wait(1) debounce = false end end end
script.Parent.Touched:connect(onTouched)
I forgot to add the "Humanoid"s agter Tool.Parent |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 25 Aug 2011 11:12 AM |
What?!
That changes WalkSpeed if your Health is on 0
And btw whats that "Tool"? |
|
|
| Report Abuse |
|
|
verpy12
|
  |
| Joined: 13 May 2010 |
| Total Posts: 1737 |
|
| |
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:15 AM |
@su8
Notice the "if hit.Parent.Humanoid.Health = 0"
And the tool is...
q.q
I'll get fixing that. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 25 Aug 2011 11:16 AM |
| Why you need to check health (With one "=" You just set it) |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:17 AM |
| Yeah, I added what "Tool" is, but still won't work. |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:18 AM |
@su8
I want it to be like ghostwalker. I don't want to set the enemy's health to 0, I want it to be when the enemy's health is AT zero, the gain walkspeed.
Derp. |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2011 11:19 AM |
| This script fails. If your health is 0, why would you want to change you walkspeed? |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 25 Aug 2011 11:20 AM |
| So that script was inside a handle?, you should say that first... |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:22 AM |
@Cachinnation No, when your opponent's health is 0.
@su8
Posted: 08-25-2011 09:07 AM I seem to have it fixed, but now I have to put it into the handle. |
|
|
| Report Abuse |
|
|
dribson
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 13635 |
|
|
| 25 Aug 2011 11:30 AM |
| Eh, I'll just hold it off until tomorrow, when people who actually point me in better directions. |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2011 12:42 PM |
function onTouched(hit) if debounce == true then return end if debounce == false then debounce = true if hit.Parent.Humanoid.Health ~= 0 then hit.Parent.Walkspeed = hit.Parent.Walkspeed + 0.5 wait(1) debounce = false end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2011 12:47 PM |
| Put Spleen's script, but if that is your entire script you need to put at the start either debounce = true or debounce = false, or else it will break because you never specified debounce |
|
|
| Report Abuse |
|
|