Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 10 years ago
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

Log in to vote
1
Answered by 10 years ago
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)
0
Thanks loads! nightmare13542 45 — 10y
Ad

Answer this question