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 » Scripters
Home Search
 

Re: door opening script

Previous Thread :: Next Thread 
MaximumMinimizer is not online. MaximumMinimizer
Joined: 26 May 2013
Total Posts: 1629
11 Jan 2014 11:36 PM
local door = script.Parent

function open()
-- This function will open the door.
door.CanCollide = false -- Make players able to walk through the door.

for transparency = 0, 1, .1 do
door.Transparency = transparency
wait(.1)
end
end

function close()
-- This function will close the door.
for transparency = 1, 0, -.1 do
door.Transparency = transparency
wait(.1)
end

door.CanCollide = true -- Make players unable to walk through the door.
end

-- This function returns the player a certain part belongs to.
function get_player(part)
--iterate over each player
for _, player in ipairs(game.Players:GetPlayers()) do
--if the part is within the player's character
if part:IsDescendantOf(player.Character) then
--return the player
return player
end
end
end


door.Touched:connect(function(part)
-- If it isn't a character that touched the door, then we ignore it.
local player = get_player(part)
if not player then return end

local allow = (
player.Name == "MrDoomBringer" or
player.Name == "JulienDethurens" or
player.Name == "blocco" or
player.Name == "NXTBoy" or
player:IsInGroup(127081) and player:IsFriendsWith(game.CreatorId) or -- This demonstrates how you can use 'and' to combine two restrictions.
game:GetService('BadgeService'):UserHasBadge(player.userId, 1032571) or
game.CreatorId == player.userId
)
if allow then
open()
delay(4, close)
end
end)
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
11 Jan 2014 11:37 PM
And why did you post that here?
Report Abuse
MaximumMinimizer is not online. MaximumMinimizer
Joined: 26 May 2013
Total Posts: 1629
11 Jan 2014 11:39 PM
ROBLOX Forum>>Game Creation and Developement>>Scripters
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
11 Jan 2014 11:44 PM
"This is the place for discussion about scripting."
"This forum is for advanced scripters to hang out and discuss code."
"advanced" + "discuss"
What you posted isn't advanced, and it surely isn't gonna spark any discussion other than debates about whether it belongs here or not.
Report Abuse
MaximumMinimizer is not online. MaximumMinimizer
Joined: 26 May 2013
Total Posts: 1629
11 Jan 2014 11:52 PM
scripting forum is for scripts

are you stupid or something
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
11 Jan 2014 11:55 PM
It is for discussing scripts and scripting techniques, not posting scripts themselves for no apparent reason. Posting random scripts like that is considered spam, and it isn't even advanced.
Report Abuse
Ilicet is not online. Ilicet
Joined: 03 Sep 2008
Total Posts: 3447
11 Jan 2014 11:59 PM
Obvious troll. I don't think anyone can be that incompetent in the attic.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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