TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
|
| 26 Dec 2011 11:48 AM |
I'm not good of a scripter much at all but would this work? It's for a window like in zombie mode.
x = game.workspace.door1
x.maxhealth = 150
if health = 120 then remove() wood1
if health = 90 then remove() wood2
if health = 60 then remove() wood3
if health = 30 then remove() wood4
if health = 0 then remove() wood5 ------------------------------- function onclick(clicked)
if health = 0 then + 30
if health = 30 then + 30
if health = 60 then + 30
if health = 90 then + 30
if health =120 then + 30
if health = 150 then + 0 |
|
|
| Report Abuse |
|
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
|
| 26 Dec 2011 11:49 AM |
door1: The first window (Each window will have a different number)
wood(1, 2, 3, 4, 5): the pecies of wood in or on the window. |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 26 Dec 2011 11:49 AM |
For each if you need an end, And health does not exist. You did not define it. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2011 11:52 AM |
Output? Your script has a lot of errors, showing us the output can help us fix them.
~Trappee?Trapper~ |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 26 Dec 2011 11:53 AM |
Trapper
Any scripter would easily be able to see these errors without an output. |
|
|
| Report Abuse |
|
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
|
| 26 Dec 2011 11:54 AM |
| I give scripting a bad name but can you tell me the right script? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 26 Dec 2011 11:55 AM |
@xvgigakid
Dude! Maybe he didn't wanna say the errors. Stop being negative everytime! |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 11:57 AM |
| You'd better start using the Output (View -> Output), then run the script. Check what the output tells you and try to change the script to fix it. When something fails to fix we are here to help you :). |
|
|
| Report Abuse |
|
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
|
| 26 Dec 2011 11:58 AM |
So I go to edit mode. Click the green play button. Then look at output and it should tell me? |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 26 Dec 2011 11:58 AM |
@Miz
I was telling trapper that an output would be pointless with this script... |
|
|
| Report Abuse |
|
|
xvgigakid
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 4407 |
|
|
| 26 Dec 2011 11:59 AM |
@Tame
No go to ROBLOX Studio, Click View>Output. |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 11:59 AM |
You should use Roblox Studio while scripting. Under your Start menu in Windows you should be able to find it.
There you have a flying camera for your ease. You can test using the green play button there. You can test your game with a walking character in Roblox Studio by doing Tools -> Test -> Play solo.
Start using Studio, since it really helps. |
|
|
| Report Abuse |
|
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
|
| 26 Dec 2011 12:00 PM |
But between 1/100 How close did I get? |
|
|
| Report Abuse |
|
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
| |
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
|
| 26 Dec 2011 12:01 PM |
| I can't do play solo because it lags a lot, so I just click save then exit then click play. |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 12:02 PM |
| Minimize the Studio screen, then open Solo. Then it shouldn't lag as much. |
|
|
| Report Abuse |
|
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
|
| 26 Dec 2011 12:09 PM |
The first thing it said was:
Workspace.Script:5: 'then' expected near '='
I know it means I have to put then somewhere else but where? |
|
|
| Report Abuse |
|
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 12:11 PM |
| What is line 5? Let's start with that. |
|
|
| Report Abuse |
|
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
| |
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 12:19 PM |
There should be a double = (so ==). In conditions like if's, until's you should always use a double =. health = 120 means 'set health to 120'. health == 120 means 'check if health is the same as 120'. |
|
|
| Report Abuse |
|
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
| |
|
dennisvdz
|
  |
| Joined: 14 Dec 2008 |
| Total Posts: 3710 |
|
|
| 26 Dec 2011 12:21 PM |
| Now you do. Fix it everywhere and let's run it again. |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2011 12:22 PM |
@xv, you are so negative. I was suggesting Output so he could see the errors himself.
~Trappee?Trapper~ |
|
|
| Report Abuse |
|
|
TameDrone
|
  |
| Joined: 09 Dec 2010 |
| Total Posts: 1006 |
|
|
| 26 Dec 2011 12:24 PM |
x = game.workspace.door1
x.maxhealth = 150
if health = 120 then remove() wood1
if health = 90 then remove() wood2
if health = 60 then remove() wood3
if health = 30 then remove() wood4
if health = 0 then remove() wood5 ------------------------------- function onclick(clicked)
if health = 0 then + 30
if health = 30 then + 30
if health = 60 then + 30
if health = 90 then + 30
if health =120 then + 30
if health = 150 then + 0
x = game.workspace.door1
x.maxhealth = 150
if health == 120 then remove() wood1
if health == 90 then remove() wood2
if health == 60 then remove() wood3
if health == 30 then remove() wood4
if health == 0 then remove() wood5 ------------------------------- function onclick(clicked)
if health = 0 then health = 30
if health = 30 then health = 60
if health = 60 then health = 90
if health = 90 then health = 120
if health =120 then health = 150
if health = 150 then health = 150
Is the second one better? |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 26 Dec 2011 12:26 PM |
| Dude, for EVERY if statement use two equal signs. And that script is only better by like .01 |
|
|
| Report Abuse |
|
|