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: VIP Door Script

Previous Thread :: Next Thread 
Hazania is not online. Hazania
Joined: 04 Jun 2010
Total Posts: 1344
27 Nov 2012 10:20 PM
So I just made a door and I want to be the only one able to go through it. So this seems like a simple script right? Well I can't get it to work and I don't want to use someone else's. So here is my script:
function ontouched(hit)
if hit.Parent = "Hazania" then
script.Parent.CanCollide = false
wait(3)
script.Parent.CanCollide = true
else
end
end
script.Parent.Touched:connect(ontouched)
Report Abuse
christheoneuknow is not online. christheoneuknow
Joined: 04 Jun 2010
Total Posts: 3194
27 Nov 2012 10:21 PM
if hit.Parent.Name* ==* "Hazania" then


Report Abuse
Hazania is not online. Hazania
Joined: 04 Jun 2010
Total Posts: 1344
27 Nov 2012 10:32 PM
Script now read as follows:

function ontouched(hit)
if hit.Parent.Name == "Hazania" then
script.Parent.CanCollide = false
wait(3)
script.Parent.CanCollide = true
end
end
script.Parent.Touched:connect(ontouched)

Still doesn't work. Although something was done right because now the touch interest actually appears.
Report Abuse
christheoneuknow is not online. christheoneuknow
Joined: 04 Jun 2010
Total Posts: 3194
27 Nov 2012 10:34 PM
try



function ontouched(hit)
if (hit.Parent.Name == "Hazania") then
script.Parent.CanCollide = false
wait(3)
script.Parent.CanCollide = true
end
end
script.Parent.Touched:connect(ontouched)

but you must know if your doing this in play solo your name will be Player.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
27 Nov 2012 10:35 PM
script.Parent.Touched:connect(function(hit)
h = hit.Parent
if h.Name == "Workspace" then return end
if hit.Parent.Name == "Hazania" then
script.Parent.CanCollide = false
wait(3)
script.Parent.CanCollide = true
end
end)

http://www.youtube.com/watch?v=m0iNzj6gTlE&NR=1&feature=fvwp
Report Abuse
christheoneuknow is not online. christheoneuknow
Joined: 04 Jun 2010
Total Posts: 3194
27 Nov 2012 10:37 PM
@thedeath


Moving the connect to the top doesnt change anything. And how does the workspace touch the door?
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
27 Nov 2012 10:40 PM
"if h.Name == "Workspace" then return end"
He did that to make sure the part touching it was in a model. I think.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
27 Nov 2012 10:45 PM
@christheoneuknow, Making sure that the item touching was a model.
@screw, yep :P

http://www.youtube.com/watch?v=m0iNzj6gTlE&NR=1&feature=fvwp
Report Abuse
GhostSailor is not online. GhostSailor
Joined: 02 Jul 2010
Total Posts: 1913
27 Nov 2012 10:58 PM
Then he has no idea what he is doing.

h.Parent.Name
Bro, it can't be the workspace. The workspace can't touch things.

Lrn2Script

-~Obly of C&G~-
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
27 Nov 2012 11:02 PM
@Ghost, I was saying that a brick could touch it that is not in a model.
I know how to script, if you look at my places, thank you very much

http://www.youtube.com/watch?v=m0iNzj6gTlE&NR=1&feature=fvwp
Report Abuse
GhostSailor is not online. GhostSailor
Joined: 02 Jul 2010
Total Posts: 1913
27 Nov 2012 11:19 PM
h.Name == "Workspace"

That's proof that you don't.
Kthx. Gobwey.

-~Obly of C&G~-
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
27 Nov 2012 11:32 PM
You can't understand a simple mistake?

You should go away, I have been in scripting helpers longer than you and that 'h.Name == "Workspace"' was an accident. Just because I made a mistake doesn't mean I can't script.

http://www.youtube.com/watch?v=m0iNzj6gTlE&NR=1&feature=fvwp
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
27 Nov 2012 11:33 PM
script.Parent.Touched:connect(function(hit)
h = hit.Parent
if h.Parent.Name == "Workspace" then return end
if hit.Parent.Name == "Hazania" then
script.Parent.CanCollide = false
wait(3)
script.Parent.CanCollide = true
end
end)

you happy fail troll?


http://www.youtube.com/watch?v=m0iNzj6gTlE&NR=1&feature=fvwp
Report Abuse
GhostSailor is not online. GhostSailor
Joined: 02 Jul 2010
Total Posts: 1913
27 Nov 2012 11:55 PM
You obviously haven't been in scripting helpers long enough to spot an alt. Kthx.
Also, you dun goofed, and didn't use a variable.

h = hit.Parent
if h.Parent.Name == "Workspace" then return end
if hit.Parent.Name == "Hazania" then

h is hit.Parent

and then, you refer to hit.Parent

Declaring variables and then not using them is derp, bro. Derp.

-~Obly of C&G~-
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
28 Nov 2012 09:23 AM
What's you to prove that I've not been here longer, ask miz656, ElectricBlaze, knightmareXD, and 18cwatford and they'll say I've been here way longer than you. Also, why get so worked up about one little mistake.

Goodbye fail troll.

http://www.youtube.com/watch?v=m0iNzj6gTlE&NR=1&feature=fvwp
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
28 Nov 2012 09:24 AM
People also have different ways of scripting that works. I don't have to script the way you tell me to. I can script however I want, so if I clarify variables and only use them once, then so be it.

http://www.youtube.com/watch?v=m0iNzj6gTlE&NR=1&feature=fvwp
Report Abuse
christheoneuknow is not online. christheoneuknow
Joined: 04 Jun 2010
Total Posts: 3194
28 Nov 2012 04:49 PM
>corrects someone
>has a mistake in his correction that makes the script not work
>says he knows what he's doing
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
28 Nov 2012 05:39 PM
lol @christ

http://www.youtube.com/watch?v=m0iNzj6gTlE&NR=1&feature=fvwp
Report Abuse
Hazania is not online. Hazania
Joined: 04 Jun 2010
Total Posts: 1344
28 Nov 2012 07:01 PM
Well thanks guys, you helped me out. :D
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