|
| 12 May 2014 09:45 AM |
I've been having a problem where it doesn't change the door transparency to 0.7 whenever I say an answer in Uppercase.
local source = string.upper(speaker.Name) msg = string.upper(msg)
if (msg == "Door") then Door.CanCollide = false Door.Transparency = 0.7 wait(5) Door.CanCollide = true Door.Transparency = 0 end
Is there any solution to have it register for lowercase and Uppercase?
|
|
|
| Report Abuse |
|
|
|
| 12 May 2014 09:49 AM |
function chat(player,msg) if msg:Upper()=="ANSWER" then script.Parent.Transparecy=0.7 end end
game.Players.PlayerAdded:connect(player) player.Chatted:connect(msg)
--didn't test it
test it idk |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 09:51 AM |
local source = string.upper(speaker.Name) msg = string.upper(msg)
print(msg)
if (msg == "Door") then Door.CanCollide = false Door.Transparency = 0.7 wait(5) Door.CanCollide = true Door.Transparency = 0 end |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 09:53 AM |
@OP and @BJCarpenter
"if (msg == "Door") then"
Must be DOOR and not Door |
|
|
| Report Abuse |
|
|
|
| 12 May 2014 09:57 AM |
--Place the following script in the door. --Made by Wreckerbuster67, credits unnecessary but would be appreciated.
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if string.lower(msg) == string.lower("ANSWER") then --change "ANSWER" to the answer to the question. script.Parent.CanCollide = false script.Parent.Transparency = 0.7 wait(5) script.Parent.CanCollide = true script.Parent.Transparency = 0 end end) end) |
|
|
| Report Abuse |
|
|