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: Global VIP door [New edition, ignore the old one]

Previous Thread :: Next Thread 
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:07 PM
NOTE: I trashed the old one because I made some updates. So thats why.
So anyway, here's the VIP script:
print("VIP Door Script loaded")
permission = G.Permission.Tier1
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 = 1
Door.CanCollide = false
wait(1)
Door.CanCollide = true
Door.Transparency = 1
end
end
end
script.Parent.Touched:connect(onTouched)
And the global value script:
G.Permission = {
Tier1 = {"minicl55", "SCARFACIAL", "breadandmilk","combativewolffe","malasiscookieguy","Chiba20","fart101"},
Tier2 = {"minicl55", "SCARFACIAL", "Chiba20", "fart101"},
Tier3 = {"minicl55", "SCARFACIAL", "fart101"}
}
The global values is in game.Workspace, the VIP door script is in the VIP door (so game.Workspace.VIP door.VIP door script)
Any idea why this might not work?

--minicl55, the magical unicorn--
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:10 PM
Please help :D

--minicl55, the magical unicorn--
Report Abuse
danin444 is not online. danin444
Joined: 10 Jun 2009
Total Posts: 2140
07 Sep 2011 05:13 PM
where do you add people in the script, and if so, can u add more ppl?
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:14 PM
G.Permission = {
Tier1 = {"minicl55", "SCARFACIAL", "breadandmilk","combativewolffe","malasiscookieguy","Chiba20","fart101"},
Tier2 = {"minicl55", "SCARFACIAL", "Chiba20", "fart101"},
Tier3 = {"minicl55", "SCARFACIAL", "fart101"}
}

--minicl55, the magical unicorn--
Report Abuse
danin444 is not online. danin444
Joined: 10 Jun 2009
Total Posts: 2140
07 Sep 2011 05:16 PM
so what are tiers exactly and why do you need three? I am sorry man, I'm honestly a noob at scripting
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:18 PM
don't worry about it.

In my primary, there are 3 doors.

Admins, super admins, and full admins (all handpicked by me). BTW, its for my primary, REA, which minicl55 (my main) is leading and banned for saying "I hate the mods"



--minicl55, the magical unicorn--
Report Abuse
danin444 is not online. danin444
Joined: 10 Jun 2009
Total Posts: 2140
07 Sep 2011 05:20 PM
oh.... thanks for info can i just have on tier? and btw lame reason for getting banned lol
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
07 Sep 2011 05:20 PM
I believe there is a series of doors, where Tier 1 is for slightly important people, where Tier 3 is more exclusive, and such.

Anyway, I did mention before that when indexing/referencing things in the global table, you need underscores. For example (My chrome extension will make this look like italics to me, I believe:)

_G.Table = {
Tier1 = {"blah."},
Tier2 = {"BLARGH"},
Tier3 = {"HerpDerp>.<"},
}

print(_G.Table.Tier1[1])

Whether tables in tables works is unknown to me, really, if they do work, that should be correct, I believe.
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:21 PM
so the VIP door is fine, right?

--minicl55, the magical unicorn--
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
07 Sep 2011 05:22 PM
Ah, so it didn't. Good news, I would have hated for things to be missed because I don't know the *Forum Enhancer's* encoding syntax and whatnot.
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
07 Sep 2011 05:23 PM
Well, is there any output?

Try putting in the underscores, and see what happens.
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:23 PM
okey dokey, thanks :D

I'm testing for output now.

--minicl55, the magical unicorn--
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:25 PM
no output

--minicl55, the magical unicorn--
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:26 PM
well, no output besides the normal "placed stamper tool in game.Players.fart101.Backpack"...

--minicl55, the magical unicorn--
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:40 PM
bump

--minicl55, the magical unicorn--
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:41 PM
wait, I missed something. Output = blah.

--minicl55, the magical unicorn--
Report Abuse
danin444 is not online. danin444
Joined: 10 Jun 2009
Total Posts: 2140
07 Sep 2011 05:44 PM
how do u link the doors to the script???
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
07 Sep 2011 05:48 PM
Sooooo, if you haven't added it in to YOUR script yet, here you go:

print("VIP Door Script loaded")
response = nil
permission = _G.Permission.Tier1

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

local Door = script.Parent

function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if human then
print("Human touched door")
checkOkToLetIn(human.Parent.Name)
if response then
print("Human passed test")
Door.Transparency = 1
Door.CanCollide = false
wait(1)
Door.CanCollide = true
Door.Transparency = 1
else return
end
end
end
script.Parent.Touched:connect(onTouched)



And the table:

_G.Permission = {
Tier1 = {"minicl55", "SCARFACIAL", "breadandmilk","combativewolffe","malasiscookieguy","Chiba20","fart101"},
Tier2 = {"minicl55", "SCARFACIAL", "Chiba20", "fart101"},
Tier3 = {"minicl55", "SCARFACIAL", "fart101"}
}
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:49 PM
Thank you :D

--minicl55, the magical unicorn--
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 05:56 PM
I tested it and it still doesn't work... any idea why?

--minicl55, the magical unicorn--
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
07 Sep 2011 05:57 PM
Still no output?
Report Abuse
Zarcius is not online. Zarcius
Joined: 08 Dec 2007
Total Posts: 3024
07 Sep 2011 05:59 PM
print("VIP Door Script loaded")
response = nil
permission = _G.Permission.Tier1
function checkOkToLetIn(name)
for i = 1,#permission do
if (string.upper(name) == string.upper(permission[i])) then
response = true
end
else
response = false
end
end
local Door = script.Parent
function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if human then
print("Human touched door")
checkOkToLetIn(human.Parent.Name)
if response then
print("Human passed test")
Door.Transparency = 1
Door.CanCollide = false
wait(1)
Door.CanCollide = true
Door.Transparency = 1
else return
end
end
end
wait()
response = nil
script.Parent.Touched:connect(onTouched)


And the table:
_G.Permission = {
Tier1 = {"minicl55", "SCARFACIAL", "breadandmilk","combativewolffe","malasiscookieguy","Chiba20","fart101"},
Tier2 = {"minicl55", "SCARFACIAL", "Chiba20", "fart101"},
Tier3 = {"minicl55", "SCARFACIAL", "fart101"}
}

I dunno if this'll work either, I've just never really used figured out exactly how return deals with variables, so I took it out.
Report Abuse
fart101 is not online. fart101
Joined: 16 Dec 2011
Total Posts: 350
07 Sep 2011 07:51 PM
still doesn't work..

Output: none.

--minicl55, the magical unicorn--
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