Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to open and close door using chat?

I have this script using chat to open the door But I can't make close door when we said close

local command = ":open" 
local unlocked = false 

local whiteList = {
	["Megadude1536"] = true;
	[1] = true;
} 

local door = script.Parent
game.Players.PlayerAdded:connect(function(player)
	if ((whiteList[player.Name]) or (whiteList[player.userId]) or (player.userId == game.CreatorId) or (unlocked)) then
		player.Chatted:connect(function(input)
			if ((input:lower() == command:lower()) and (door.CanCollide)) then
				door.CanCollide = false
				door.Transparency = 1
				wait(2)
				door.CanCollide=true
				door.Transparency = 0
			end
		end)
	end
end)

can you fix this script:

  • The door will not close if we not said ":close"

4 comments

1

So you're wanting to make a close command as well? What exactly is wrong with this script in particular?

0

Nothing seems wrong with this script. You just didn't put anything in there for a ":close". However, it does look like the door opens then automatically closes after 2 seconds, so do you need a close command?

0

Yes

0

Here's the deal, you have already done half the work assuming this is your script, your own original content. All you would need to do is change the command, flips the trues with false, and flip the transparencies. So you're basically requesting we do the other half of the work for you?

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.