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: Door script

Previous Thread :: Next Thread 
bandithunter123 is not online. bandithunter123
Joined: 27 Oct 2012
Total Posts: 242
09 Nov 2014 07:01 AM
Door =game.Workspace.Door
function touched(part)
if game.Players:GetPlayerFromCharacter(part.Parent) then
local plr=game.Players:GetPlayerFromCharacter(part.Parent)
Door.Transparency = 0.5
Door.Cancollide = false
wait(5)
Door.Transparency = 0
Door.Cancollide = true

end

end

script.Parent.Touched:connect(touched)


It is: a door that opens when its touched for 5secs
its errors: -Remains transparent
-Doesnt become false cancollide(aka wont become walktrough)
Report Abuse
sarim786 is not online. sarim786
Joined: 02 Oct 2011
Total Posts: 206
09 Nov 2014 07:11 AM
You made a mistake, I think, I'm a beginner scripter

Door = game.Workspace.Door
function onTouched(part)
if game.Players:GetPlayerFromCharacter(part.Parent) then
local plr=game.Players:GetPlayerFromCharacter(part.Parent)
Door.Transparency = 0.5
Door.Cancollide = false
wait(5)
Door.Transparency = 0
Door.Cancollide = true

end

end

script.Parent.Touched:connect(touched)
Report Abuse
bandithunter123 is not online. bandithunter123
Joined: 27 Oct 2012
Total Posts: 242
10 Nov 2014 11:01 AM
Door = game.Workspace.Door
function onTouched(part)
if game.Players:GetPlayerFromCharacter(part.Parent) then
local plr=game.Players:GetPlayerFromCharacter(part.Parent)
Door.Transparency = 0.5
Door.Cancollide = false
wait(5)
Door.Transparency = 0
Door.Cancollide = true

end

end

script.Parent.Touched:connect(onTouched)

Doesnt work. It remains transparent and wong become false canccollide.
Report Abuse
OzzyFin is not online. OzzyFin
Joined: 07 Jun 2011
Total Posts: 3600
10 Nov 2014 11:21 AM
Do

function touched(part)
print(part,part.Parent)

If it prints "Handle" then your gear's or hat's Handle touches it and it won't go on because there is no Player for Character called, for example "Hat".
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
10 Nov 2014 11:24 AM
Sarim, onTouched does nothing. It is just the wiki's lame habit of confusing you. He had it correct the first time. You could name it anything you want, technically.
Report Abuse
ipadboy123 is not online. ipadboy123
Joined: 05 Apr 2010
Total Posts: 6475
10 Nov 2014 12:49 PM
"Door =game.Workspace.Door"

Make sure you put a space after the equals (=)

So it's then Door = game.Workspace.Door
Report Abuse
Raidorz is not online. Raidorz
Joined: 28 Apr 2011
Total Posts: 5221
10 Nov 2014 01:01 PM
Change CanCollide = false and Transparency = 1

Also, is this gonna be a single player RPG?
Report Abuse
bandithunter123 is not online. bandithunter123
Joined: 27 Oct 2012
Total Posts: 242
14 Nov 2014 08:52 AM
Going to make a game, yes. Its going to be as Evolve Alpha(changed idea to it)
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