generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: My script won't work.

Previous Thread :: Next Thread 
dribson is not online. 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 is online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
25 Aug 2011 10:58 AM
You Output means you need 2 ==.
Report Abuse
dribson is not online. 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 is not online. bloob827
Joined: 01 Aug 2010
Total Posts: 6867
25 Aug 2011 11:01 AM
the third if statement needs a 'then'
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
25 Aug 2011 11:02 AM
"=", Sets a value
"==", Checks a value.
Report Abuse
dribson is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. verpy12
Joined: 13 May 2010
Total Posts: 1737
25 Aug 2011 11:14 AM
I knew that aswell :D
Report Abuse
dribson is not online. 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 is not online. 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 is not online. 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 is not online. 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
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
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 is not online. 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 is not online. 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 is not online. 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
SpleenYanks is not online. SpleenYanks
Joined: 24 Aug 2008
Total Posts: 921
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
EverquestI is not online. EverquestI
Joined: 03 Feb 2011
Total Posts: 11109
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image