I'm trying to make a holographic training center. I need to use Chat Commands to do it, my script works with one chat Command, but it cant do 2 in one script.
local GW = game.Workspace
local GWD = game.Workspace.Doors
local isAdmin = {["PixelYT"] = true, ["Vescatur"] = true, ["7035"] = true, ["Bladecrix"] = true, ["Player"] = true}
function onChatted(message, player)
if message == "Open" and isAdmin[player.Name] then
GWD.Door.Transparency = 1
GWD.Door2.Transparency = 1
GWD.Door.CanCollide = false
GWD.Dooe2.CanCollide = false
end
end
function onChatted(message, player)
if message == "Close" and isAdmin[player.Name] then
GWD.Door.Transparency = 0
GWD.Door2.Transparency = 0
GWD.Door.CanCollide = true
GWD.Door2.CanCollide = true
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)
That script opens a door, but only the Close command works, help please!

1 comment
Nope, thats a minor error, It won't work.