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: Would this work? If not please fix it

Previous Thread :: Next Thread 
TameDrone is not online. 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 is not online. 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 is not online. 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
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
26 Dec 2011 12:01 PM
-1.
Kthx.
Report Abuse
TameDrone is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. TameDrone
Joined: 09 Dec 2010
Total Posts: 1006
26 Dec 2011 12:15 PM
if health = 120 then
Report Abuse
dennisvdz is not online. 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 is not online. TameDrone
Joined: 09 Dec 2010
Total Posts: 1006
26 Dec 2011 12:20 PM
I never knew =/
Report Abuse
dennisvdz is not online. 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
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
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 is not online. 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 is not online. 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
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