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 do I make a Tycoon Buy Button explosion resistant?

Previous Thread :: Next Thread 
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:01 PM
^
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
06 Oct 2011 01:02 PM
You can't


<
Report Abuse
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:02 PM
:O
Report Abuse
jojobenten is not online. jojobenten
Joined: 27 Jan 2009
Total Posts: 8819
06 Oct 2011 01:03 PM
D:

Is there a reason it can't be anchored?
Report Abuse
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:07 PM
It is anchored, but if a explosion hits it, it will destroy the scripts inside or something.
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
06 Oct 2011 01:11 PM
[ Content Deleted ]
Report Abuse
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:18 PM
Button Script:


model = script.Parent.Parent--name of model can be script.Parent
backup = model:clone()
enabled = true
function regenerate(hit)
if not enabled then return end
enabled = false
if hit.Parent.Humanoid~= nil then
cash = game.Players:findFirstChild(hit.Parent.Name).leaderstats.Points -- Find out who touched.
if cash.Value >= 75 then
cash.Value = cash.Value- 75
model:remove()
wait(2)
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
enabled = true
end
end
end
script.Parent.Touched:connect(regenerate)

Explosion Script:

local larm = script.Parent:FindFirstChild("Torso")
local rarm = script.Parent:FindFirstChild("Right Leg")
local dmg = script.Parent:FindFirstChild("Head")

function findNearestTorso(pos)
local list = game.Workspace:children()
local torso = nil
local dist = 15
local temp = nil
local human = nil
local temp2 = nil
for x = 1, #list do
temp2 = list[x]
if (temp2.className == "Model") and (temp2 ~= script.Parent) then
temp = temp2:findFirstChild("Torso")
human = temp2:findFirstChild("Humanoid")
if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
if (temp.Position - pos).magnitude < dist then
torso = temp
dist = (temp.Position - pos).magnitude
end
end
end
end
return torso
end

function Hit(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
if human ~= nil then
if script.Parent.Humanoid.Health ~= 0 then
script.Parent.Humanoid.WalkSpeed = 0
local Color = script.Parent["Body Colors"]
local FakeHead = script.Parent["FakeHead"]
Color.HeadColor = BrickColor.new("Really black")
Color.LeftArmColor = BrickColor.new("Black")
Color.RightArmColor = BrickColor.new("Really black")
Color.LeftLegColor = BrickColor.new("Black")
Color.RightLegColor = BrickColor.new("Black")
Color.TorsoColor = BrickColor.new("Black")
FakeHead.BrickColor = BrickColor.new("Bright red")
wait(0.75)
Color.HeadColor = BrickColor.new("Really black")
Color.LeftArmColor = BrickColor.new("Black")
Color.RightArmColor = BrickColor.new("Really black")
Color.LeftLegColor = BrickColor.new("Black")
Color.RightLegColor = BrickColor.new("Black")
Color.TorsoColor = BrickColor.new("Black")
FakeHead.BrickColor = BrickColor.new("Really black")
wait(0.5)
Color.HeadColor = BrickColor.new("Really black")
Color.LeftArmColor = BrickColor.new("Black")
Color.RightArmColor = BrickColor.new("Really black")
Color.LeftLegColor = BrickColor.new("Black")
Color.RightLegColor = BrickColor.new("Black")
Color.TorsoColor = BrickColor.new("Black")
FakeHead.BrickColor = BrickColor.new("Bright red")
wait(0.25)
Color.HeadColor = BrickColor.new("Really black")
Color.LeftArmColor = BrickColor.new("Black")
Color.RightArmColor = BrickColor.new("Really black")
Color.LeftLegColor = BrickColor.new("Black")
Color.RightLegColor = BrickColor.new("Black")
Color.TorsoColor = BrickColor.new("Black")
FakeHead.BrickColor = BrickColor.new("Really black")
local Ex = Instance.new("Explosion")
Ex.Parent = game.Workspace
Ex.Position = script.Parent.Torso.Position
script.Parent.Torso.Name = "Torsoz"
end
end
end

larm.Touched:connect(Hit)
rarm.Touched:connect(Hit)
dmg.Touched:connect(Hit)
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
06 Oct 2011 01:20 PM
[ Content Deleted ]
Report Abuse
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:22 PM
I went JaredValdez2 on the Creeper.
It is edited a lot. And used for a different purpose now.
http://www.roblox.com/Exploditor-item?id=63179224
Report Abuse
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:24 PM
I know that I can just put a: 'Regen all buttons' Button but that is too amateur'ish for me.
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
06 Oct 2011 01:25 PM
[ Content Deleted ]
Report Abuse
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:27 PM
Stick to the topic please.
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
06 Oct 2011 01:27 PM
[ Content Deleted ]
Report Abuse
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:28 PM
Who cares if its a free model?
Jeeze Loweez.
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
06 Oct 2011 01:29 PM
[ Content Deleted ]
Report Abuse
1AmyRose1 is not online. 1AmyRose1
Joined: 01 Jun 2008
Total Posts: 3094
06 Oct 2011 01:31 PM
Kthxbye,

Thanks for helping me out here.
You'r doing a great job on the Scripting 'Helpers' forum.

Domme mogool.
Report Abuse
juriaan is not online. juriaan
Joined: 25 Nov 2008
Total Posts: 939
06 Oct 2011 01:57 PM
Oke. Je bent over de Scheef gegaan.
Denk je dan ik niet weet wat Domme Mogool betekent.
Nou dus wel.

Ik zal je grote bek maar eens houden. Anders zou niemand je helpen

For the English Forum Posters:
"Domme mogool" is just a bad word at Dutch
So I said against him. Swear against us and we wont help you at all.

Juriaan
Report Abuse
BrainScripter is not online. BrainScripter
Joined: 02 Aug 2011
Total Posts: 187
06 Oct 2011 02:26 PM
Amy, ik ben nederlands.

-♂ MYRCO♂-
Scripter, music obsessed, atheist and dutch. What else?
Report Abuse
1WOOF1 is not online. 1WOOF1
Joined: 03 May 2009
Total Posts: 20682
06 Oct 2011 02:31 PM
[ Content Deleted ]
Report Abuse
greatestdan is not online. greatestdan
Joined: 08 Sep 2008
Total Posts: 504
06 Oct 2011 03:23 PM
try putting a forcefield inside the tycoon. I know that forcefields only show on players now but they do make it so explosions do not affect anything inside the model that the forcefield is in.
Report Abuse
Rukiryo is not online. Rukiryo
Joined: 04 Sep 2009
Total Posts: 1490
06 Oct 2011 05:27 PM
Free model, yup. We like to help you with scripts, not encourage you to use noob models. As for a button, explosion's shouldnt damage it. Give us an output error! If the explosion is caused by a bullet, a simple line can fix it. At the beginning of your copied free model script, in the function, check if the hit's Parent is nil. If a gun shoots a rocket, ROBLOX will not recognise Debris as the parent of what hit it, and you'll receive an error.
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