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: Creator Door?

Previous Thread :: Next Thread 
Reboot23 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
13 Mar 2012 09:29 PM
player.Name

† KMXD †
Report Abuse
Reboot23 is not online. Reboot23
Joined: 14 Apr 2009
Total Posts: 12
13 Mar 2012 09:30 PM
Where do i need put it?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
13 Mar 2012 09:31 PM
Change where you have "player.name" to "player.Name"

† KMXD †
Report Abuse
Reboot23 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
13 Mar 2012 09:33 PM
Yes, Lua is case-sensitive.

† KMXD †
Report Abuse
RobloxNewb01 is not online. RobloxNewb01
Joined: 16 Apr 2011
Total Posts: 348
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 is not online. 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
RobloxNewb01 is not online. RobloxNewb01
Joined: 16 Apr 2011
Total Posts: 348
13 Mar 2012 09:51 PM
For a new scripter, you sure do some Medium stuff. Better then others.
Report Abuse
L2000 is not online. 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
RobloxNewb01 is not online. RobloxNewb01
Joined: 16 Apr 2011
Total Posts: 348
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
RobloxNewb01 is not online. RobloxNewb01
Joined: 16 Apr 2011
Total Posts: 348
13 Mar 2012 10:07 PM
NNOO! LATE POST!

= PURPLE NURPLE =
Report Abuse
Reboot23 is not online. 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
RobloxNewb01 is not online. RobloxNewb01
Joined: 16 Apr 2011
Total Posts: 348
13 Mar 2012 10:18 PM
Some of these aren't words.
Report Abuse
Reboot23 is not online. Reboot23
Joined: 14 Apr 2009
Total Posts: 12
13 Mar 2012 10:20 PM
The last part with "allow"?
Report Abuse
gbritt849 is not online. 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
ScriptBlust is not online. ScriptBlust
Joined: 20 Aug 2012
Total Posts: 8
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
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