|
| 27 May 2013 10:54 PM |
okay so laik, i made this command for free scriptign nd it no work...
function script(plyr,msg) if msg:lower():sub(1,2) == "c/" then if not pcall(function() loadstring(msg:sub(3))() end) then e = Instance.new("Message",Workspace).Text = "Error1!11" wait(3) e:Destroy() end end end game.Players.PlayerAdded:connect(function(plyr) plyr.Chatted:connect(function(msg) script(plyr,msg) end) end)
--it NO WORKS. Y U DO DIS?
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 27 May 2013 11:06 PM |
Bawmp.
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 28 May 2013 07:46 PM |
Bump...
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 28 May 2013 07:50 PM |
| remove the ")" from the last "end" |
|
|
| Report Abuse |
|
|
|
| 28 May 2013 07:51 PM |
um. No. That's for game.Players.PlayerAdded.
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 28 May 2013 08:16 PM |
Bump... Again.. Would I have to use a coroutine or something? -_-
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 28 May 2013 08:21 PM |
e = Instance.new("Message",Workspace).Text = "Error1!11" I don't think 2 ='s would work on the same line o-o Try: e = Instance.new("Message",Workspace) e.Text = "Error1!11" |
|
|
| Report Abuse |
|
|
|
| 28 May 2013 08:44 PM |
I did. Still no worked.. :|
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
Osyris
|
  |
| Joined: 27 Oct 2007 |
| Total Posts: 4321 |
|
|
| 28 May 2013 08:51 PM |
game.Players.PlayerAdded:connect(function(plyr) plyr.Chatted:connect(function(msg) if msg:lower():sub(1,2) == "c/" then local res={ypcall(function() loadstring(msg:sub(2))() end)} if(not res[1])then coroutine.wrap(function() local e=Instance.new('Message',Workspace) e.Text="ERROR: " .. res[2]:gsub("(.-:)","") wait(3) e:Destroy() end)() end end end) end)
--Added feature: Tells you what errored. |
|
|
| Report Abuse |
|
|
Osyris
|
  |
| Joined: 27 Oct 2007 |
| Total Posts: 4321 |
|
|
| 28 May 2013 08:56 PM |
| Slight error. Just a moment, rewriting. |
|
|
| Report Abuse |
|
|
Osyris
|
  |
| Joined: 27 Oct 2007 |
| Total Posts: 4321 |
|
|
| 28 May 2013 08:57 PM |
game.Players.PlayerAdded:connect(function(plyr) plyr.Chatted:connect(function(msg) if msg:lower():sub(1,2) == "c/" then local res={ypcall(function() loadstring(msg:sub(3))() end)} if(not res[1])then coroutine.wrap(function() local e=Instance.new('Message',Workspace) e.Text="ERROR: " .. res[2]:gsub("(.-:)","") wait(3) e:Destroy() end)() end end end) end) |
|
|
| Report Abuse |
|
|
|
| 29 May 2013 02:08 AM |
I'm perfectly fine with my own script. I didn't ask for a better version. I asked 'y dis no work?'.
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 29 May 2013 02:19 AM |
| "It doesn't work" is very ambiguous. How does it not work? |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 29 May 2013 02:26 AM |
@zack. You can't assign variable, and change it at same time. There is no logic in that.
|
|
|
| Report Abuse |
|
|
|
| 29 May 2013 02:29 AM |
@zars, If you would've actually READ through ANY of the replies, you would know I fixed that and it still didn't work. There is no logic in not reading replies.
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 May 2013 02:31 AM |
function script(plyr,msg) if msg:lower():sub(1,2) == "c/" then if not pcall(function() loadstring(msg:sub(3))() end) then e = Instance.new("Message",Workspace) e.Text = "Error!" wait(3) e:Destroy() end end end game.Players.PlayerAdded:connect(function(plyr) plyr.Chatted:connect(function(msg) script(plyr,msg) end) end)
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 29 May 2013 02:34 AM |
| Try changing the name of the function to something other than script. Not sure if it'll change anything, but it's worth a shot. |
|
|
| Report Abuse |
|
|
|
| 29 May 2013 02:40 AM |
No, it won't.
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 30 May 2013 08:29 PM |
Figured it out. Lowering the code to all lower-case letters screws errything up. yay me!
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 31 May 2013 12:05 AM |
That's odd. I ran a test and the ::lower() method of strings didn't modify the original value. So that to make a string lowercase, you have use an assignment operator:
str = "Hello, World!" str:lower() print(str) --Hello, World! str = str:lower() print(str) --hello, world!
Or that's what I remember...
|
|
|
| Report Abuse |
|
|
|
| 31 May 2013 01:24 AM |
No, it lowers all of the letter, so this would be wrong;
game.workspace.zackeryjerrypowers.humanoid.walkspeed = 40
You can't have everything lower-cased.
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 31 May 2013 01:39 AM |
Try local e..
The difference between local and nothing:
local = Representing a keyword that will do the action for you. none = Pepresenting a keyword that will understand the directory but will not do a specific action. |
|
|
| Report Abuse |
|
|
|
| 31 May 2013 01:40 AM |
That won't matter, and I just explained why it didn't work.
~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~ |
|
|
| Report Abuse |
|
|
|
| 31 May 2013 07:39 AM |
Please put local e regardless.
Also, dude, I know you fixed it, but I just don't understand how. Nowhere in your script do you assign the string to be lowercase, you just call the lower method on it.
str = "Hello, World!" str:lower() print(str) --Hello, World! str = str:lower() print(str) --hello, world!
If you run the above, you'll see that calling the lower method on a string DOESN'T make it lowercase, and you have to assign it to be lower in order for it to be lowercase, BUT your script never assigns the string to be the lowercase string.
Additionally:
if not pcall(function() loadstring(msg:sub(3))() end) then
This line is suspect. You might be interested to know that loadstring already checks for errors, and so it's pointless to have it inside pcall, and arguably less useful if you ever want to see the error message.
Consider using this:
local func, err = loadstring(msg:sub(3)) if func ~= nil then func() else --Your code continues
The Prime Jester of Scripters has spoken. |
|
|
| Report Abuse |
|
|