deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
|
| 30 May 2013 01:11 PM |
| Hi I want to make a door script that opens when shot. Any ideas how??? |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 01:13 PM |
You could edit the gun script, easiest if the gun uses raycasting.
local ray = Ray.new(CFrame stoof) hit = Workspace:findPartOnRay(ray)
if hit.Name == "Door" then edit door end
Soup's on, everybody! ~LuaLearners Writer~ |
|
|
| Report Abuse |
|
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
|
| 30 May 2013 01:17 PM |
| Well I'm kind of hoping that I could make the door have about 1000 health |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 01:22 PM |
health = 1000
local ray = Ray.new(CFrame stoof) hit = Workspace:findPartOnRay(ray)
if hit.Name == "Door" then health = health - Damage done if health == 0 then open end |
|
|
| Report Abuse |
|
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
| |
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
|
| 30 May 2013 01:35 PM |
It isn't working :/
Maybe if we use the door to script? |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 01:45 PM |
That's not the actual script, that's a layout...
Soup's on, everybody! ~LuaLearners Writer~ |
|
|
| Report Abuse |
|
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
| |
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
|
| 30 May 2013 06:50 PM |
If I wanted to make the door disappear without using the script in the weapon but the door instead and reset, would I do this?
local door = game.Workspace.Door while true do if script.Parent.Humanoid.Health=0 then Door.CanCollide= false wait(300) script.Parent.Humanoid.Health=500 wait(300) script.Parent.Humanoid.Health=500 door.CanCollide = true end wait() end
|
|
|
| Report Abuse |
|
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
| |
|
Figure65
|
  |
| Joined: 23 May 2007 |
| Total Posts: 2663 |
|
|
| 30 May 2013 07:27 PM |
local i=Instance.new("Humanoid", script.Parent) while true do if script.Parent.Humanoid.Health=="0" then do end Instance.new("Message", game.Workspace) game.Workspace.Message.Text="The door is open." script.Parent.CanCollide=false wait(5) game.Workspace.Message:Remove() script.Parent.CanCollide=true wait() end end |
|
|
| Report Abuse |
|
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
| |
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
|
| 31 May 2013 06:17 AM |
| This script keeps on crashing my studio :/ any other ideas? |
|
|
| Report Abuse |
|
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
| |
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
|
| 31 May 2013 09:06 AM |
| bump qq anyone please help |
|
|
| Report Abuse |
|
|
Arxverse
|
  |
| Joined: 30 Mar 2013 |
| Total Posts: 43 |
|
|
| 31 May 2013 09:13 AM |
You will need a Humanoid Object. I know it can be just a NumberValue, but it would be better since Humanoids have MaxHealth Property.
Then, Put this script in the Humanoid:
local Health=script.Parent local Door=Health.Parent
Health.Walkspeed=0 Health.MaxHealth=1000 Health.Health=Health.MaxHealth
if Health.Health==0 then Door.Transparency=1 Door.CanCollide=false end
--Additional Regen Script
if Health.Health==0 then local NewVal=15 local time=60 --Change to time before the wall regens it's health by 15 while Health.Health~=Health.MaxHealth do wait(time) Health.Health=Health.Health+NewVal end end
if Health.Health==Health.MaxHealth then Door.Transparency=0 Door.CanCollide=true end
Wreckerbuster67| The Apocalypse Imperium Supreme Overlord, 2iC| Conquest Private |
|
|
| Report Abuse |
|
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
|
| 31 May 2013 10:13 AM |
| kk thanks I will try it :) |
|
|
| Report Abuse |
|
|
getkoed2
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 1144 |
|
|
| 31 May 2013 10:16 AM |
put this in the humanoid
script.Parent.Changed:connect(function(property) if property == "Health" then if script.Parent.Health <= 0 then for i = script.Parent.Parent.CFrame.X, script.Parent.Parent.CFrame.X - 5, .2 do script.Parent.Parent.CFrame = CFrame.new(i, script.Parent.Parent.CFrame.Y, script.Parent.Parent.CFrame.Z) wait() end end end)
|
|
|
| Report Abuse |
|
|
getkoed2
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 1144 |
|
|
| 31 May 2013 10:17 AM |
sorry forgot an end
script.Parent.Changed:connect(function(property) if property == "Health" then if script.Parent.Health <= 0 then for i = script.Parent.Parent.CFrame.X, script.Parent.Parent.CFrame.X - 5, .2 do script.Parent.Parent.CFrame = CFrame.new(i, script.Parent.Parent.CFrame.Y, script.Parent.Parent.CFrame.Z) wait() end end end end) |
|
|
| Report Abuse |
|
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
| |
|
deemo1000
|
  |
| Joined: 30 Jun 2011 |
| Total Posts: 188 |
|
|
| 31 May 2013 11:32 AM |
| my studio is crashing again qq |
|
|
| Report Abuse |
|
|