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: I Need Help with a Script!

Previous Thread :: Next Thread 
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
08 Jun 2014 12:13 PM
I wanted to make a zombie that picks a random amount of health that it will have, so I made a script for that, but it doesn't do anything. Here is the script:
Person = Script.Parent

while true do
randomnumber = math.random(100,500)
randomnumber2 = math.random(100,499)
Person.Zombie.MaxHealth = randomnumber
wait(1)
Person.Zombie.Health = randomnumber2
end
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
08 Jun 2014 02:07 PM
Bump?
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
10 Jun 2014 03:10 PM
Bump! Bumpitty bumpitty bump!
Report Abuse
RobloxianDrawer1 is not online. RobloxianDrawer1
Joined: 28 May 2011
Total Posts: 79
10 Jun 2014 03:12 PM
local humanoid = -- Define this

humanoid.MaxHealth = math.random(100, 200)
humanoid.Health = humanoid.MaxHealth
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
10 Jun 2014 03:44 PM
That didn't work.
Report Abuse
4444vince2 is not online. 4444vince2
Joined: 08 Nov 2008
Total Posts: 4880
10 Jun 2014 04:05 PM
You know the zombie will insta heal every second...

Also you don't capitalize the S on script. :P
--try this put it into the humanoid

wait(1.5)
script.Parent.MaxHealth = math.random(100,500)
script.Parent.Health = math.random(100,500)
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
10 Jun 2014 04:35 PM
I tried that. No errors, but it did not work.
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
12 Jun 2014 02:59 PM
BUUUUUUUMMMMMMMMMMMPPPPPPPPPPPPPP!
Report Abuse
SuperiorEternal is not online. SuperiorEternal
Joined: 22 Aug 2009
Total Posts: 2365
12 Jun 2014 03:19 PM
while true do
randomnumber2 = math.random(100,499)
Person.Zombie.MaxHealth = (math.random(100,500),math.random(100,500),math.random(100,500))
wait(1)
Person.Zombie.Health = (math.random(100,499),math.random(100,499),math.random(100,499))
end
Report Abuse
SuperiorEternal is not online. SuperiorEternal
Joined: 22 Aug 2009
Total Posts: 2365
12 Jun 2014 03:19 PM
while true do
Person.Zombie.MaxHealth = (math.random(100,500),math.random(100,500),math.random(100,500))
wait(1)
Person.Zombie.Health = (math.random(100,499),math.random(100,499),math.random(100,499))
end

THIS SHOULD WORK!
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
13 Jun 2014 06:11 AM
I have not tried that yet, but why does it seem like that is a troll?
Report Abuse
SuperiorEternal is not online. SuperiorEternal
Joined: 22 Aug 2009
Total Posts: 2365
13 Jun 2014 11:55 AM
...? Maybe cause you don't know how to script?
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
13 Jun 2014 02:30 PM
I CAN script, not very well, but I can. I've made all sorts of things like brick eating bricks, bombs, and more.
Report Abuse
RobloxianDrawer1 is not online. RobloxianDrawer1
Joined: 28 May 2011
Total Posts: 79
13 Jun 2014 02:33 PM
Basically you can't script.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2014 02:34 PM
Lowercase the S in Script
Report Abuse
RobloxianDrawer1 is not online. RobloxianDrawer1
Joined: 28 May 2011
Total Posts: 79
13 Jun 2014 02:35 PM
?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2014 02:36 PM
'Person = Script.Parent'
Report Abuse
SuperiorEternal is not online. SuperiorEternal
Joined: 22 Aug 2009
Total Posts: 2365
13 Jun 2014 06:21 PM
while true do
Person.Zombie.MaxHealth = (math.random(100,500))
wait(1)
Person.Zombie.Health = (math.random(100,499))
end

There even shorter
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
19 Jun 2014 06:23 PM
That did not work. Is it even possible to do this?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
19 Jun 2014 06:24 PM
Remove the while true do and the end :P
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
21 Jun 2014 05:15 PM
That won't work.
Report Abuse
Vuva is not online. Vuva
Joined: 22 Jan 2010
Total Posts: 1102
21 Jun 2014 05:28 PM
Workspace
-   ZombieModel
   -   . . .
   -   Script
   -   Humanoid
   -   . . .

Script:
Zombie=script.Parent
Min=100
Max=500
Zombie.Humanoid.MaxHealth=Max
while wait() do
Zombie.Humanoid.Health=math.random(Min,Max)
end
Report Abuse
Superwarrior360 is not online. Superwarrior360
Joined: 21 Feb 2013
Total Posts: 2703
22 Jun 2014 08:16 PM
I actually thought that might work, unlike the other ones, but apparently it still won't work. Now I'm almost convinced that this is impossible.
Report Abuse
Vuva is not online. Vuva
Joined: 22 Jan 2010
Total Posts: 1102
22 Jun 2014 11:04 PM
If you recreated the scenario exactly as I listed it should have worked. Because I just now recreated it based on what I said and it worked. I guess I should also mention that there should be a part named "Head" inside of the ZombieModel so that you can actually see the healthbar.
Maybe I just didn't interpret what you wanted correctly though...
Report Abuse
wowomglol is not online. wowomglol
Joined: 01 Nov 2013
Total Posts: 9
22 Jun 2014 11:52 PM
randomnumber = math.random(100,500)
randomnumber2 = math.random(100,499)
Person.Zombie.Humanoid.MaxHealth = randomnumber
wait(1)
Person.Zombie.Health = randomnumber2
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