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: Owner Only door

Previous Thread :: Next Thread 
MEANDUDE87 is not online. MEANDUDE87
Joined: 09 May 2011
Total Posts: 845
04 Jul 2013 10:48 PM
Here is the script that wont work:
If http://www.roblox.com/User.aspx?ID=0 = true then cancollide= false
I'm not a good scripter, so i'm not sure what the problem is. Please help me!!!
Report Abuse
monstre180 is not online. monstre180
Joined: 02 May 2009
Total Posts: 110
04 Jul 2013 11:34 PM
Put this script in the brick, it should work



permission={"MEANDUDE87"}

function checkOkToLetIn(name)
for i = 1,#permission do
if (string.upper(name) == string.upper(permission[i])) then return true end
end
return false
end

local Door = script.Parent

function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
print("Human touched door")
if (checkOkToLetIn(human.Parent.Name)) then
print("Human passed test")
Door.Transparency = 0.8
Door.CanCollide = false
wait(1.5)
Door.CanCollide = true
Door.Transparency = 0
else human.Health= 0
end
end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
darkggod is not online. darkggod
Joined: 04 Feb 2011
Total Posts: 8316
05 Jul 2013 01:42 AM
--Made By Darkggod

doorname = "" --the doors name in workspace

door = workspace:FindFirstChild(doorname)
delay = 4 --Wait time

function open()
door.Transparency = 0.4
door.CanCollide = false
end

function close()
door.Transparency = 0
door.CanCollide = true
end

function onTouch(part)
char = part.Parent
player = game.Players:GetPlayerFromCharacter(part.Parent)
if part.Parent:findFirstChild("Humanoid") ~= nil and player.userId == game.CreatorId then
open()
wait(delay)
close()
end
end
script.Parent.Touched:connect(onTouch)



--Put this script inside the door
kthxbai



~LS Emperor Darkggod~
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
05 Jul 2013 02:18 AM
Please @you two above,

allowed = {"Usering","Noob"}

script.Parent.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
for _,v in pairs(allowed) do
if player.Name == v then
script.Parent.CanCollide = false
script.Parent.Transparency = .5
wait(3)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
end
end
end)

~ Add 6276 posts to my post count ~
Report Abuse
darkggod is not online. darkggod
Joined: 04 Feb 2011
Total Posts: 8316
05 Jul 2013 02:18 AM
well mine only lets the legit owner in :)

~LS Emperor Darkggod~
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
05 Jul 2013 02:20 AM
Want to fight?

script.Parent.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.userId == game.CreatorId then
script.Parent.CanCollide = false
script.Parent.Transparency = .5
wait(3)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
end
end)

~ Add 6276 posts to my post count ~
Report Abuse
Usering is not online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
05 Jul 2013 02:20 AM
oops it called player before it checked if it existed.

script.Parent.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and player.userId == game.CreatorId then
script.Parent.CanCollide = false
script.Parent.Transparency = .5
wait(3)
script.Parent.CanCollide = true
script.Parent.Transparency = 0
end
end)


~ Add 6276 posts to my post count ~
Report Abuse
darkggod is not online. darkggod
Joined: 04 Feb 2011
Total Posts: 8316
05 Jul 2013 02:21 AM
wut ever i just wanted to add functions
ok

~LS Emperor Darkggod~
Report Abuse
SethDusek5 is not online. SethDusek5
Joined: 26 Mar 2011
Total Posts: 2580
05 Jul 2013 03:22 AM
Stop confusing the person, here it is. A simple one.

local debounce = false
script.Parent.Touched:connect(function(hit)
if debounce == false then
debounce = true
local owner = "MEANDUDE87" --Your name here
if hit.Name == owner then
script.Parent.Transparency = 1
script.Parent.CanCollide = false
wait(5) --Put in how long you want it to wait, until the door closes.
script.Parent.Transparency = 0
script.Parent.CanCollide = true
debounce = false
end
end
end)

Put this inside the door, it should work. :)
Report Abuse
MEANDUDE87 is not online. MEANDUDE87
Joined: 09 May 2011
Total Posts: 845
10 Jul 2013 05:51 PM
Thanks
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Jul 2013 06:29 PM
That would check if the part that was touched was named the same thing as the OP.
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