|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|