I made two serperate scripts, because then it only worked. The commands only work once. I need serious help.
Script One (Open Lobby)
--DO NOT CHANGE!!! local isAdmin = {["bosswalrus"] = true, ["BrockHCCS"] = true, ["mac3na3na"] = true, ["ultimatedeathwolf"] = true, ["BJL008"] = true, ["bealot"] = true} --Open Lobby Function function onChatted(message, player) --Open Lobby if message == "open/lobby" and isAdmin[player.Name] then game.Workspace.LobbyDoor.LobbyDoorPart.Transparency = 1 game.Worksapce.LobbyDoor.LobbyDoorPart.CanCollide = false end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end)
Script Two (Close Lobby)
--DO NOT CHANGE!!! local isAdmin = {["bosswalrus"] = true, ["BrockHCCS"] = true, ["mac3na3na"] = true, ["ultimatedeathwolf"] = true, ["BJL008"] = true, ["bealot"] = true} --Open Lobby Function function onChatted(message, player) --Open Lobby if message == "close/lobby" and isAdmin[player.Name] then game.Workspace.LobbyDoor.LobbyDoorPart.Transparency = 0 game.Worksapce.LobbyDoor.LobbyDoorPart.CanCollide = true end end game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(message) onChatted(message, player) end) end)
The commands only work once. I need serious help.
Well, your two scripts are exactly the same... They both open the door. You need to make one of them set the Transparency to 0 and the Can Collide to true, and also change the command for one, like "close/lobby" or something. You can also use just one script and use an elseif. So,
if message == "open/lobby" and isAdmin[player.Name] then game.Workspace.LobbyDoor.LobbyDoorPart.Transparency = 1 game.Worksapce.LobbyDoor.LobbyDoorPart.CanCollide = false elseif message == "close/lobby" and isAdmin[player.Name] then game.Workspace.LobbyDoor.LobbyDoorPart.Transparency = 0 game.Worksapce.LobbyDoor.LobbyDoorPart.CanCollide = true end
I think this would make your code work, but it's still kind of ugly. Here's how I do my holo scripts:
local admins = {"bob","jeff","john","joe"} function isAdmin(name) for i,v in pairs(admins) do if v:lower() == name:lower() then return true end end return false end game.Players.PlayerAdded:connect(function(plr) if isAdmin(plr.Name) then plr.Chatted:connect(function(msg) --stuff end) end end)
It's really your choice though. I have a holo script in my models if you want to study it.
local isAdmin = {"bosswalrus", "BrockHCCS", "mac3na3na", "ultimatedeathwolf", "BJL008","bealot"} local firstl = ":" --Set to something you want like :openl or c/openl
function checkadmin(name) for _,v in pairs(isAdmin) do if name:lower() == isAdmin:lower() then return true end end return false end
game.Players.PlayerAdded:connect(function(plr) if checkadmin(plr.Name) then plr.Chatted:connect(function(msg) if msg:lower():sub(2,7) == "closel" and msg:sub(1,1) == firstl then game.Workspace.LobbyDoor.LobbyDoorPart.Transparency = 0 game.Worksapce.LobbyDoor.LobbyDoorPart.CanCollide = true end if msg:lower():sub(2,6) == "openl" and msg:sub(1,1) == first then game.Workspace.LobbyDoor.LobbyDoorPart.Transparency = 1 game.Worksapce.LobbyDoor.LobbyDoorPart.CanCollide = false end end)