|
| 19 Oct 2014 11:39 AM |
Can you help me have it accept uppercase letters? door = script.Parent
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name) msg = string.lower(msg)
if (msg == "Sir.") then door.CanCollide = false door.Transparency = 0.7 wait(5) door.CanCollide = true door.Transparency = 0 end
end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered)
|
|
|
| Report Abuse |
|
|
|
| 19 Oct 2014 11:41 AM |
msg = string.lower(msg)
Try reading the script before posing here, I found this in 20 seconds. |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2014 11:44 AM |
| That line of script won't work. |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Oct 2014 11:47 AM |
| When I changed both lowers to uppers the script wouldn't work. |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2014 11:48 AM |
In your original script, you first converted msg to lowercase, and then later try to do this:
if (msg == "Sir.") then
How do you expect 'msg', which you've converted entirely to lowercase, to now include an uppercase "S"?
~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~ |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 19 Oct 2014 11:51 AM |
door = script.Parent
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name) msg = msg:lower()
if (msg == "sir.") then door.CanCollide = false door.Transparency = 0.7 wait(5) door.CanCollide = true door.Transparency = 0 end
end
function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end
game.Players.ChildAdded:connect(onPlayerEntered)
|
|
|
| Report Abuse |
|
|