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: Can someone look at my script, I need it to dissappear once I die (outside of the plane)

Previous Thread :: Next Thread 
KazzzMann is not online. KazzzMann
Joined: 23 Mar 2009
Total Posts: 619
23 Jan 2012 05:49 PM
So in this script the vehicle is supposes to remove once the pwner is dead. It works just fine while I'm on the seat, but once I'm off of it then die it just stays there. Heres the script.

local plane = script.Parent.Parent
local seat = script.Parent


function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
plane.Parent = hit.Parent
end
end

function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if human == nil then
seat:remove()
plane:remove()
end
end


script.Parent.Touched:connect(onTouched)
Report Abuse
MrCrazyman42 is not online. MrCrazyman42
Joined: 01 Feb 2011
Total Posts: 740
23 Jan 2012 05:53 PM
You honestly need to put...

Instance.new.Transparency = 1

I think that is it... I really just don't do Transparency things...
Report Abuse
KazzzMann is not online. KazzzMann
Joined: 23 Mar 2009
Total Posts: 619
23 Jan 2012 05:55 PM
*oops I just re-read my post I put "pwner" instead of owner.
Report Abuse
KazzzMann is not online. KazzzMann
Joined: 23 Mar 2009
Total Posts: 619
23 Jan 2012 05:55 PM
Just curious, but what will changing the Transparency of the plane do?
Report Abuse
KazzzMann is not online. KazzzMann
Joined: 23 Mar 2009
Total Posts: 619
23 Jan 2012 06:10 PM
~Bumpity~
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
23 Jan 2012 06:14 PM
@Kazz He is being a troll dont listen to him.
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
23 Jan 2012 06:15 PM
Oh and by the way do this,

local plane = script.Parent.Parent
local seat = script.Parent


function onTouchedA(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
plane.Parent = hit.Parent
end
end

function onTouchedB(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if human == nil then
seat:remove()
plane:remove()
end
end


script.Parent.Touched:connect(function(h) onTouchedA(h) onTouchedB(h) end)

Last time you were running only one function.
This should run both.
Report Abuse
KazzzMann is not online. KazzzMann
Joined: 23 Mar 2009
Total Posts: 619
23 Jan 2012 06:16 PM
Thank you very much!
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