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: string.lower

Previous Thread :: Next Thread 
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 09:39 PM
I found out how to use string.lower

But...

How can I use it with the first part of this "if" (The findFirstChild)

if game.Players:findFirstChild(script.Parent.Parent.Box1.Text) ~= nil or (string.lower(script.Parent.Parent.Box1.Text)) == "me" or (string.lower(script.Parent.Parent.Box1.Text)) == "all" and (string.lower(script.Parent.Parent.CommandBar.Text)) == "kill"then


Its to check if a player is in the game
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
17 Nov 2012 09:51 PM
if game.Players:findFirstChild(string.lower(script.Parent.Parent.Box1.Text))~=nil then
print("YOU ARE A PIRATE")
end
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
17 Nov 2012 09:51 PM
When you mention a string.lower, whatever you're going to turn into lower cases, put it inside the parenthisis.
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 09:53 PM
@Rap
The thing about that is

if someones whole username wasnt in string.lower with that

It wouldnt find it...

What Im trying to do is make the text box not case sensitive.
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
17 Nov 2012 09:55 PM
What?
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
17 Nov 2012 09:56 PM
I did turn it into a lower case. Just try it out and tell me what you exactly want to show.
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 09:57 PM
I want it to find [script.Parent.Parent.Box1.Text] in the game.Players but I want it to not be case sensitive.
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
17 Nov 2012 09:58 PM
You want it both lower cased?
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 10:00 PM
If the players name "Player1" I want it to find it even if script.Parent.Parent.Box1.Text is "PlAyEr1" or "PLAYer1" or anything
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
17 Nov 2012 10:02 PM
for n,player in pairs(game.Players:GetPlayers())do
if(string.lower(player.Name)==string.lower(script.Parent.Box1.Text))then
-- Stuff
end
end
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
17 Nov 2012 10:02 PM
^ Yeah that.

Roblox wouldn't let me post. It said it had a swear or something offending.
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 10:06 PM
@1Topcop
That broke my script...

This is the rest of it


--Kill command start

if game.Players:findFirstChild(script.Parent.Parent.Box1.Text) ~= nil or (string.lower(script.Parent.Parent.Box1.Text)) == "me" or (string.lower(script.Parent.Parent.Box1.Text)) == "all" and (string.lower(script.Parent.Parent.CommandBar.Text)) == "kill"then

if KillLock == true then

GuiMessage.new("This command is locked")

else

if (string.lower(script.Parent.Parent.Box1.Text)) == "all" then

for Count = 1, #game.Players:GetPlayers() do

game.Players:GetPlayers()[Count].Character:breakJoints()

end

elseif (string.lower(script.Parent.Parent.Box1.Text)) == "me" then

if game.Players[script.Parent.Parent.Parent.Parent.Name].Character.Humanoid.Health == 0 then

GuiMessage.new("You are already dead")

game.Players[script.Parent.Parent.Parent.Parent.Name].Character:breakJoints()

else

game.Players[script.Parent.Parent.Parent.Parent.Name].Character:breakJoints()

end

elseif game.Players:findFirstChild(script.Parent.Parent.Box1.Text) and game.Players[script.Parent.Parent.Box1.Text].Character.Humanoid.Health == 0 then

GuiMessage.new(""..script.Parent.Parent.Box1.Text.." is already dead")

game.Players[script.Parent.Parent.Box1.Text].Character:breakJoints()

elseif game.Players:findFirstChild(script.Parent.Parent.Box1.Text) then

game.Players[script.Parent.Parent.Box1.Text].Character:breakJoints()

end end

--Kill command end
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
17 Nov 2012 10:09 PM
Modify this codee

function getPlayer ( name , character , object ) -- Find by name , find by character , or find by an object
if name then
-- return game.Players:FindFirstChild ( name )
for i , v in pairs ( game.Players:GetPlayers ( ) ) do -- Gives you a chance to add name shortner
if v.Name:lower () == name:lower ( )
return v
end
end
elseif character then
return game.Players:GetPlayerFromCharacter ( character )
else
return game.Players:GetPlayerFromCharacter ( object.Parent )
end
end

function kill ( character )
getPlayer ( something.something.Text ).Character:BreakJoints ( )
end

Chop Code. CC
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 10:12 PM
@Chop
Disconnected event because of exception
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
17 Nov 2012 10:14 PM
function getPlayer ( name , character , object ) -- Find by name , find by character , or find by an object
if name then
-- return game.Players:FindFirstChild ( name )
for i , v in pairs ( game.Players:GetPlayers ( ) ) do -- Gives you a chance to add name shortner
if v.Name:lower () == name:lower ( )
return v
end
end
elseif character then
return game.Players:GetPlayerFromCharacter ( character )
else
return game.Players:GetPlayerFromCharacter ( object.Parent )
end
end

function kill ( character )
character:BreakJoints ( )
end

kill ( getPlayer ( something.something.Text ).Character )

Do that

Chop Code. CC
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
17 Nov 2012 10:21 PM
LOL what your trying to do is in exproexploits gui... They find the players and it's pickable.. Except I think your trying to make gui commands..
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 10:22 PM
Players.Player1.PlayerGui.AdminGui.Enter.CommandScript:115: 'then' expected near 'return'
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 10:24 PM
@Cro
Im not trying to hack.

Im making a admin GUI
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
17 Nov 2012 10:31 PM
I didn't mean hacking, I meant that what your trying to do is in 'their' exploitgui..
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 10:34 PM
If you have the code from it, Could you post the part I need?
Report Abuse
michaelaqz4 is not online. michaelaqz4
Joined: 23 Sep 2009
Total Posts: 1940
17 Nov 2012 10:53 PM
Bump...
Report Abuse
nrscsy is not online. nrscsy
Joined: 09 Nov 2012
Total Posts: 465
17 Nov 2012 11:12 PM
http://lua-users
.org/wiki/
StringLibraryTutorial

That link is perfect for string documentation. Some of it can't be done in Roblox Lua, but it will satisfy your needs.
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