Hello, well i don't really need to make the chat command only for specific players but i would appreciate it. Well please fix my script.
d1 = game.Workspace.Door d2 = game.Workspace.Door2 game.Players.ChildAdded:connect(function(Player) Player.Chatted:connect(function(msg) if msg == "open2" then d1.Transparency = 0.5 d2.Transparency = 0.5 d1.BrickColor = ("Forest green") d2.BrickColor = ("Forest green") d1.CanCollide = false d2.CanCollide = false end end) end)
IDK Why it doesn't change the color of part, and make the cancollide false. The only thing it does is make transparency 0.5 if someone could fix this script for me and maybe make it like true admin that has like admin list it would be really helpful for me. I am pretty basic in lua and i can't do anything advanced.
d1 = game.Workspace.Door d2 = game.Workspace.Door2 game.Players.ChildAdded:connect(function(Player) Player.Chatted:connect(function(msg) if msg == "open2" then d1.Transparency = 0.5 d2.Transparency = 0.5 d1.BrickColor = BrickColor.new("Forest green") d2.BrickColor = BrickColor.new("Forest green") d1.CanCollide = false d2.CanCollide = false end end) end)
A simple fix, really. When changing a color of a brick, or a few other things, you must use BrickColor.new.
Refer here for more information.
pff I can do alot better than the person above. try this.
d1 = game.Workspace.Door1 d2 = game.Workspace.Door2 game.Players.ChildAdded:connect(function(Player) print(Player.Name) Player.Chatted:connect(function(msg) print(Player.Name .. ": " .. msg) if msg:lower() == "open" then d1.Transparency = 0.5 d2.Transparency = 0.5 d1.BrickColor = BrickColor.new("Forest green") d2.BrickColor = BrickColor.new("Forest green") d1.CanCollide = false d2.CanCollide = false elseif msg:lower() == 'close' then d1.Transparency = 0 d2.Transparency = 0 d1.BrickColor = BrickColor.new("Really red") d2.BrickColor = BrickColor.new("Really red") d1.CanCollide = true d2.CanCollide = true end end) end)