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: Doesn't work..

Previous Thread :: Next Thread 
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
15 Mar 2013 12:53 AM
function onTouch(hit)

h = hit.Parent:findFirstChild("Humanoid")
if hit ~= nil then
if h.Name == "Key" then
script.Parent:Destroy()
h:Destroy()
script.Parent.Parent.Door.CanCollide = false
wait(5)
script.Parent.Parent.Door.CanCollide = true
else
end
end

end
script.Parent.Touched:connect(onTouch)
No output.. :/
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
15 Mar 2013 01:10 AM
local d

function onTouch(hit)

h = hit and hit.Parent and hit.Parent:findFirstChild("Humanoid")
if h.Name == "Key" and not d then
d = true
hit.Parent:Destroy()
script.Parent.Parent.Door.CanCollide = false
wait(5)
script.Parent.Parent.Door.CanCollide = true
d = nil
end

end
script.Parent.Touched:connect(onTouch)
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
15 Mar 2013 01:18 AM
doesn't work
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
15 Mar 2013 01:33 AM
So you have part, with humanoid named Key?
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
15 Mar 2013 01:54 AM
i made it a model. go to my profile and look , hard to explain.
Report Abuse
einsteinK is not online. einsteinK
Joined: 22 May 2011
Total Posts: 1015
15 Mar 2013 02:37 AM
First:

h=...:findFirstChild("FIRSTNAME")

Later:

if h.Name == "OTHERNAME" then


So you search for something called FIRSTNAME, ok.
But after that you check if the name of it is OTHERNAME ...
You looked for FIRSTNAME so it's name would be FIRSTNAME -.-
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
15 Mar 2013 03:12 AM
Lol, thanks.
Helped alot, I'll be sure to include helpers in a credit gui
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