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: How would I make this script?

Previous Thread :: Next Thread 
werewolf2747 is not online. werewolf2747
Joined: 17 Mar 2009
Total Posts: 206
05 Aug 2010 10:13 PM
I want to make a script for my cars that allows it to drive and hit things, and when it hits a certain number of things, it will create smoke out of the hood as it takes on more and more damage, and when it hits too many things, it will catch the hood on fire and explode in 10 seconds, and the remains of the car will be black and on fire. (But I want the fire to go out over 20 seconds.)
Thanks 4 reading this, and if you can, please help me. :D

Xx werewolf2747 xX
Report Abuse
werewolf2747 is not online. werewolf2747
Joined: 17 Mar 2009
Total Posts: 206
05 Aug 2010 10:18 PM
I really wish someone would just say something!
Report Abuse
Sam010100001 is not online. Sam010100001
Top 100 Poster
Joined: 09 Aug 2009
Total Posts: 34814
05 Aug 2010 10:21 PM
Bool values. 'nuff said.
Report Abuse
filhynate is not online. filhynate
Joined: 08 Jun 2010
Total Posts: 48
05 Aug 2010 10:21 PM
ok, well I dont know....thats a hard one...hmmmm well...I believe that an advanced scripter might now...im sorry im a new scripter
Report Abuse
werewolf2747 is not online. werewolf2747
Joined: 17 Mar 2009
Total Posts: 206
05 Aug 2010 10:22 PM
Same here :p
Report Abuse
gameboy97q is not online. gameboy97q
Joined: 13 Sep 2008
Total Posts: 2831
05 Aug 2010 10:24 PM
hits = 0
phaseone = 4 --How many objects it has to hit until it smokes.
phasetwo = 9 --How many objects it has to hit until it sets on fire.
function onTouch(hit)
if hits > phaseone and hit < phasetwo then
local z = Instance.new("Smoke")
z.Color = Color3.new(51,51,51)
z.Parent = script.Parent
elseif hit >phasetwo then
local f = Instance.new("Fire")
f.Parent = script.Parent
wait(10)
local e = Instance.new("Explosion")
e.Position = script.Parent.Position
e.BlastPressure = 900000
e.Parent = script.Parent
local children = script.Parent.Parent:GetChildren()
for i = 1,#children do
if children[i].className == "Part" or children[i].className == "WedgePart" then
local fire = Instance.new("Fire")
fire.Parent = children[i]
end
end
end
end

script.Parent.Touched:connect(onTouch)














Put this in any brick that you want to take dammage. Make sure that every part is in the Chasis.
Report Abuse
Sam010100001 is not online. Sam010100001
Top 100 Poster
Joined: 09 Aug 2009
Total Posts: 34814
05 Aug 2010 10:26 PM
function t()
script.BoolValue.Value = script.BoolValue.Value + 1
end

function crash()
if script.BoolValue.Value == 20 then
V = Instance.new("Explosion")
V.Position = script.Parent.Position
V.Parent = Script.Parent
end
end


script.Parent.Touched:connect(t)
script.BoolValue.Changed:connect(crash)


Errors will be found, because this is untested, and I made it in the forum.
Report Abuse
gameboy97q is not online. gameboy97q
Joined: 13 Sep 2008
Total Posts: 2831
05 Aug 2010 10:27 PM
Oops. Forgot one thing.

New Version:


hits = 0
phaseone = 4 --How many objects it has to hit until it smokes.
phasetwo = 9 --How many objects it has to hit until it sets on fire.
function onTouch(hit)
if hits > phaseone and hit < phasetwo then
local z = Instance.new("Smoke")
z.Color = Color3.new(51,51,51)
z.Parent = script.Parent
elseif hit >phasetwo then
local f = Instance.new("Fire")
f.Parent = script.Parent
wait(10)
local e = Instance.new("Explosion")
e.Position = script.Parent.Position
e.BlastPressure = 900000
e.Parent = script.Parent
local children = script.Parent.Parent:GetChildren()
for i = 1,#children do
if children[i].className == "Part" or children[i].className == "WedgePart" then
local fire = Instance.new("Fire")
fire.Parent = children[i]
end
end
end
hits = hits + 1
end

script.Parent.Touched:connect(onTouch)
Report Abuse
werewolf2747 is not online. werewolf2747
Joined: 17 Mar 2009
Total Posts: 206
05 Aug 2010 10:29 PM
Wow. Thanks guys! :D
Report Abuse
Sam010100001 is not online. Sam010100001
Top 100 Poster
Joined: 09 Aug 2009
Total Posts: 34814
05 Aug 2010 10:31 PM
Oops. A boolValue woldn't work. *facepalm*

Use a IntValue or NumValue
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