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

How would I make the following script open a door when a player says a certain word?

door = script.parent
msg = string.lower(msg)
 if (msg == "open") then
	door.Transparency = 1
	door.CanCollide = false
	wait(4)
	door.Transparency = 0
	door.CanCollide = true
end

I'm trying to make this script open a door, then close it, but so far- No luck. Any input would be helpful, thank you!

1 answer

✓ Accepted answer
door = script.Parent

game.Players.PlayerAdded:connect(function(player)
	player.Chatted:connect(function(msg)
		if msg == "open door" then
		door.Transparency = 1
		door.CanCollide = false
			elseif msg == "close door" then
			door.Transparency = 0
			door.CanCollide = true
		end
	end)
end)

1 comment

0

Thanks loads!

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