of     1   

Thunderx10
#36791000Wednesday, November 10, 2010 5:32 AM GMT

How do I get a players name from a string.sub? As in like using a string.sub to check what you say after something else. like if you said "nuke/Thunderx10" then it would find the stuff after nuke/
Thunderx10
#36791023Wednesday, November 10, 2010 5:34 AM GMT

and let me use it like player = (string.sub(msg, 1,#msg) Something like that.
Thunderx10
#36791129Wednesday, November 10, 2010 5:43 AM GMT

Halp?
XlegoX
#36791304Wednesday, November 10, 2010 6:02 AM GMT

It's easy as long as there's just a single name that you need to find: string:sub(a, b) gets the substring from the a'th to the b'th character. Using a negative number for one means "away from the end", for example, -1 means "the last character", or "0 away from the end". So, something along the lines of this: string:sub(6, -1) Gets from the 6th to the last character. "nuke/" contains 5 characters, so the first character of a person's name should be the 6'th, so 6 for the start, and, you want to get all the way to the end of what they entered, so -1 for the end.
Thunderx10
#36791351Wednesday, November 10, 2010 6:07 AM GMT

Oh... Thanks xLEGOx.
Thunderx10
#36791380Wednesday, November 10, 2010 6:10 AM GMT

So would something like this work..? person = "Thunderx10" chat = game.Players[person] function onChatted(msg) if (string.sub(msg, 1,5) == "nuke/") then name = string.sub(6, -1) plyr = game:getService("Workspace")[name] plyr:BreakJoints() end end chat.Chatted:connect(onChatted)
Thunderx10
#36791669Wednesday, November 10, 2010 6:58 AM GMT

Help....
Thunderx10
#36791829Wednesday, November 10, 2010 7:29 AM GMT

Can anyone help me? spec? crazy?
pighead10
#36791909Wednesday, November 10, 2010 7:39 AM GMT

if (string.sub(msg, 1,5) == "nuke/") then That line is correct. To get everything after that, you simply need to put string.sub(msg(6))
XlegoX
#36794367Wednesday, November 10, 2010 2:00 PM GMT

No, that's wrong. And even if you did write it down right it's better to explicitly put the "-1" index at the end.
RobloxMasterDX
#36794555Wednesday, November 10, 2010 2:17 PM GMT

check the free models you can learn faster there. :3 admin scripts etc... function o(noob,msg) msg:lower() if (string.sub(msg,1,5) == "nuke/") then --"nuke/5" has 5 characters so 1,5 Nuke(workspace[string.sub(msg,6)]) -- err else end end
Shady12345
#36794863Wednesday, November 10, 2010 2:48 PM GMT

Something like this should work. person = "Thunderx10" chat = game:getService("Players"):findFirstChild(person) function onChatted(msg) if (string.sub(msg, 1,5) == "nuke/") then name = string.sub(msg, 6) if game:getService("Players"):findFirstChild(name) ~= nil then game:getService("Players"):findFirstChild(name).Character:BreakJoints() else print("No person such as: " ..name.. " found!") end end end chat.Chatted:connect(onChatted)
pighead10
#36794938Wednesday, November 10, 2010 2:53 PM GMT

"No, that's wrong." http://wiki.roblox.com/index.php/Function_Dump/String_Manipulation#string.sub_.28s.2C_i_.5B.2C_j.5D.29 Why would it be better to put the -1 there anyway?
Shady12345
#36794959Wednesday, November 10, 2010 2:54 PM GMT

Its not wrong :) It works perfectly.
pighead10
#36795069Wednesday, November 10, 2010 3:05 PM GMT

"string.sub(msg(6))" whoops, xleg was right, I typed it wrong. string.sub(msg,6) is what I meant :/
pighead10
#36795104Wednesday, November 10, 2010 3:07 PM GMT

From the wiki: "string.sub (s, i [, j]) Returns the substring of s that starts at i and continues until j; i and j may be negative. If j is absent, then it is assumed to be equal to -1"
myrco919
#36795142Wednesday, November 10, 2010 3:10 PM GMT

[ Content Deleted ]
Shady12345
#36795177Wednesday, November 10, 2010 3:12 PM GMT

@myrco Learn to script, you don't need anylinks :) function chat(msg, speaker) -- if msg == "" then -- end -- and you just ad on what you need :) end -- connection line has however you want it.
myrco919
#36795184Wednesday, November 10, 2010 3:13 PM GMT

[ Content Deleted ]
myrco919
#36795191Wednesday, November 10, 2010 3:13 PM GMT

[ Content Deleted ]
Shady12345
#36838808Thursday, November 11, 2010 2:52 PM GMT

goodluck with that. go learn lua, java, c++ then you'l know how to script wel :)
bloob827
#36839136Thursday, November 11, 2010 3:08 PM GMT

lolwut says the cow at dawn function onChatted(msg, speaker) _,_,cmd,parm = msg:find("^(%w*)/(.*)") if cmd == "kill" then target = game.Players:findFirstChild(parm) target.Humanoid.Health = 0 end end function p(newplayer) if newPlayer.Name == "Thunderx10" then newPlayer.Chatted:connect(function(msg) onChatted(msg,speaker) end) end end game.Players.ChildAdded:connect(p)

    of     1