generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: My script only accepts lower case letters.

Previous Thread :: Next Thread 
luluball785 is not online. luluball785
Joined: 27 Feb 2013
Total Posts: 215
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
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
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
luluball785 is not online. luluball785
Joined: 27 Feb 2013
Total Posts: 215
19 Oct 2014 11:44 AM
That line of script won't work.
Report Abuse
SiIentSins is not online. SiIentSins
Joined: 20 Jul 2011
Total Posts: 1553
19 Oct 2014 11:46 AM
mfg
Report Abuse
luluball785 is not online. luluball785
Joined: 27 Feb 2013
Total Posts: 215
19 Oct 2014 11:47 AM
When I changed both lowers to uppers the script wouldn't work.
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image