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 » Scripters
Home Search
 

Re: String Parsing

Previous Thread :: Next Thread 
Blitzorz is not online. Blitzorz
Joined: 24 Aug 2012
Total Posts: 31
04 Jun 2014 07:59 PM
Alright slags, I use string patterns to create commands on my admin script, why do they only work on players who enter before me.

cmds={}

cmds["kill"]=function(plr)
for _,v in next,game.Players:GetPlayers() do
if string.find(v.Name:lower(),plr:lower()) ~= nil then
ypcall(function() v.Character:BreakJoints() end)
end
end
end

function onChatted(msg)
cmd,parm=string.match(msg,"^(%w*)%s(%w*)")
if cmd then
cmd=cmd:lower()
if cmds[cmd] then
cmds[cmd](parm)
else
return print("That is not a command!")
end
end
end
game.Players.LocalPlayer.Chatted:connect(onChatted)



Can someone please tell me why this wouldn't work on a player who enters after you enter? Giving rare admin to the first person to give me the correct answer....
Report Abuse
magnalite is not online. magnalite
Joined: 18 Oct 2009
Total Posts: 2467
04 Jun 2014 08:05 PM
You scripted it wrong.
Report Abuse
Blitzorz is not online. Blitzorz
Joined: 24 Aug 2012
Total Posts: 31
04 Jun 2014 08:09 PM
Prove it
Report Abuse
CoolioTree is not online. CoolioTree
Joined: 26 Dec 2012
Total Posts: 2509
04 Jun 2014 08:14 PM
It doesn't work
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
04 Jun 2014 08:47 PM
"Prove it"
It doesn't work, there's your proof.
Report Abuse
Insoul is not online. Insoul
Joined: 04 May 2014
Total Posts: 66
04 Jun 2014 09:29 PM
ya

cmds={}

so how can you
cmds['kill']

no

cmds={ kill=function() kill(); end; };

cmds.kill();

ok now we got it

herro Im syKo
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
04 Jun 2014 09:57 PM
Insoul: What are you doing, that works fine
Report Abuse
Blitzorz is not online. Blitzorz
Joined: 24 Aug 2012
Total Posts: 31
04 Jun 2014 10:43 PM
Don't worry Tas, they're stupid. Just trying to figure out why it only works on players who were already in the server when I entered.
Report Abuse
RA2lover is not online. RA2lover
Joined: 09 Nov 2008
Total Posts: 1254
05 Jun 2014 09:49 AM
you probably made the script crash by entering or something.
Report Abuse
ninetailfox73 is not online. ninetailfox73
Joined: 11 Mar 2008
Total Posts: 1954
05 Jun 2014 12:20 PM
PlayerAdded doesn't work in a LocalScript. (That's probably not what you did wrong though)
Report Abuse
Insoul is not online. Insoul
Joined: 04 May 2014
Total Posts: 66
11 Jun 2014 07:43 PM
blueTalsem : it was the cmds={kill=function() end} part
that kinda threw me off.

herro Im syKo
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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