Reboot23
|
  |
| Joined: 14 Apr 2009 |
| Total Posts: 12 |
|
|
| 13 Mar 2012 09:27 PM |
local door = script.parent
function open() door.CanCollide = false for transparency = 0, 1, .1 do door.Transparency = transparency wait(.1) end end
function close() for transparency = 1, 0, -.1 do door.Transparency = transparency wait(.1) end
door.CanCollide = true end
function get_player(part) for _, player in ipairs(game.Players:GetPlayers()) do if part:IsDescendantOf(Player.Character) then
return player end end end end
door.Touched:connect(function(part)
local player = get_player(part) if not player then return end
local allow = ( player.name == "Tricky883285" or player.name == "gbritt849" or game.CreatorId == player.userId ) if allow then open() delay(4, close) end end) |
|
|
| Report Abuse |
|
|
| |
|
Reboot23
|
  |
| Joined: 14 Apr 2009 |
| Total Posts: 12 |
|
| |
|
|
| 13 Mar 2012 09:31 PM |
Change where you have "player.name" to "player.Name"
† KMXD † |
|
|
| Report Abuse |
|
|
Reboot23
|
  |
| Joined: 14 Apr 2009 |
| Total Posts: 12 |
|
|
| 13 Mar 2012 09:32 PM |
| Ok!, Thanks!, but a capitalization will really mess it up? |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 09:33 PM |
Yes, Lua is case-sensitive.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 09:35 PM |
local allow = { player.Name == "Tricky883285" or player.Name == "gbritt849" or game.CreatorId == player.userId }
--I think it should be put in a table.
|
|
|
| Report Abuse |
|
|
Reboot23
|
  |
| Joined: 14 Apr 2009 |
| Total Posts: 12 |
|
|
| 13 Mar 2012 09:36 PM |
Ahh man, its still not working :/ did i put to many tabs or enters or something? im new to scripting |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 09:51 PM |
| For a new scripter, you sure do some Medium stuff. Better then others. |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 13 Mar 2012 10:02 PM |
You have too many ends for the get_player(part), and that's calling Player.Character (It needs to be player; Player is a nil value).
local door = script.parent function open() door.CanCollide = false for transparency = 0, 1, .1 do door.Transparency = transparency wait(.1) end end function close() for transparency = 1, 0, -.1 do door.Transparency = transparency wait(.1) end
door.CanCollide = true end function get_player(part) for _, player in ipairs(game.Players:GetPlayers()) do if part:IsDescendantOf(player.Character) then
return player end end end door.Touched:connect(function(part) local player = get_player(part) if not player then return end
local allow = ( player.name == "Tricky883285" or player.name == "gbritt849" or game.CreatorId == player.userId ) if allow then open() delay(4, close) end end) |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 10:06 PM |
local door = script.Parent
function open() door.CanCollide = true door.Transparency = 0.1 end function close() door.Transparency = 0.1
door.CanCollide = false end
function get_player(part) for _, player in ipairs(game.Players:GetPlayers()) do if part:IsDescendantOf(player.Character) then
return player end end end
door.Touched:connect(function(part)
local player = get_player(part) if not player then return end
local allow = player.Name == "Tricky883285" local allo = player.Name == "gbritt849" local t = player.Name == "RobloxNewb01" local all = game.CreatorId == player.userId if allow or allo or all or t then open() delay(4, close) end end) |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 10:07 PM |
NNOO! LATE POST!
= PURPLE NURPLE = |
|
|
| Report Abuse |
|
|
Reboot23
|
  |
| Joined: 14 Apr 2009 |
| Total Posts: 12 |
|
|
| 13 Mar 2012 10:12 PM |
| Im not sure what some of those words are dude! You type too fast, haha |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2012 10:18 PM |
| Some of these aren't words. |
|
|
| Report Abuse |
|
|
Reboot23
|
  |
| Joined: 14 Apr 2009 |
| Total Posts: 12 |
|
|
| 13 Mar 2012 10:20 PM |
| The last part with "allow"? |
|
|
| Report Abuse |
|
|
gbritt849
|
  |
| Joined: 06 Feb 2012 |
| Total Posts: 15 |
|
|
| 22 Aug 2012 09:27 AM |
| reboot why did why did you use tricky and mines name? |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2012 09:39 AM |
This one should work.......
local door = script.parent
function open() door.CanCollide = false
for transparency = 0, 1, .1 do door.Transparency = transparency wait(.1) end end
function close()
for transparency = 1, 0, -.1 do door.Transparency = transparency wait(.1) end
door.CanCollide = true end
function get_player(part)
for _, player in ipairs(game.Players:GetPlayers()) do
if part:IsDescendantOf(Player.Character) then
return player end end
door.Touched:connect(function(part)
local player = get_player(part) if not player then return end
local allow = ( player.name == "Tricky883285" or player.name == "gbritt849" or game.CreatorId == player.userId ) if allow then open() delay(4, close) end end) end
|
|
|
| Report Abuse |
|
|