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: Looking for a door script

Previous Thread :: Next Thread 
deemo1000 is not online. 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
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
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 is not online. 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
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
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 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
30 May 2013 01:24 PM
thanks I will test it
Report Abuse
deemo1000 is not online. 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
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
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 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
30 May 2013 05:27 PM
oh ok
Report Abuse
deemo1000 is not online. 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 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
30 May 2013 07:14 PM
bump D:
Report Abuse
Figure65 is not online. 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 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
31 May 2013 05:27 AM
Thanks I will try it
Report Abuse
deemo1000 is not online. 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 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
31 May 2013 08:12 AM
bump D:
Report Abuse
deemo1000 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
31 May 2013 09:06 AM
bump qq anyone please help
Report Abuse
Arxverse is not online. 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 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
31 May 2013 10:13 AM
kk thanks I will try it :)
Report Abuse
getkoed2 is not online. 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 is not online. 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 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
31 May 2013 11:18 AM
ok
Report Abuse
deemo1000 is not online. deemo1000
Joined: 30 Jun 2011
Total Posts: 188
31 May 2013 11:32 AM
my studio is crashing again qq
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