I've been trying to make a restricted door using this:
playerAllow = ("player:IsInGroup(2910772)")
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
local allow(playerAllow) --Error
if allow then
open()
delay(4, close)
end
end)
I tried changing the player:IsInGroup(2910772) because before I tried it and it wouldn't agree because this part:
local allow(player:IsInGroup(2910772)) --Error
if allow then
open()
delay(4, close)
end
end)
And if I did this:
local allow(player:IsInGroup(2910772)
if <--Error-- allow then -- then say )' Expected to close something about that.
open()
delay(4, close)
end
end)
But now, I think I'm doing it wrong or something... because it now says
local allow(playerAllow) --Error, must be a Variable or field.
I thought I changed it into a variable. when I used
playerAllow = ("player:IsInGroup(2910772)")
I just figured out how to use scripts today and have looked at all the tutorials including variables. However none helped.
Also. When I use the command bar for: print(playerAllow) it comes up as:
print(playerAllow) nil instead of: playerAllow = player:IsInGroup(2910772) Like it should, right? Again, I'm still a noob >._. Plz help.

3 comments
Or maybe I just did something wrong with the door? Idk. Still plz help.
Quoting your code will make it a string
Edited to fix formatting. Make your questions readable!!