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: y dis no work? :c

Previous Thread :: Next Thread 
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
27 May 2013 11:06 PM
Bawmp.

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
28 May 2013 07:46 PM
Bump...

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
RobTheHobo is not online. RobTheHobo
Joined: 09 Apr 2013
Total Posts: 1374
28 May 2013 07:50 PM
remove the ")" from the last "end"
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
28 May 2013 07:51 PM
um. No.
That's for game.Players.PlayerAdded.

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
28 May 2013 08:16 PM
Bump... Again..
Would I have to use a coroutine or something? -_-

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
28 May 2013 08:44 PM
I did.
Still no worked.. :|

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
Osyris is not online. 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 is not online. Osyris
Joined: 27 Oct 2007
Total Posts: 4321
28 May 2013 08:56 PM
Slight error. Just a moment, rewriting.
Report Abuse
Osyris is not online. 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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
29 May 2013 02:19 AM
"It doesn't work" is very ambiguous. How does it not work?
Report Abuse
zars15 is not online. 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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
29 May 2013 02:29 AM
Show us the new version.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
29 May 2013 02:40 AM
No, it won't.

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
30 May 2013 08:29 PM
Figured it out.
Lowering the code to all lower-case letters screws errything up.
yay me!

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
SharpUserKnifeIV is not online. SharpUserKnifeIV
Joined: 03 Apr 2013
Total Posts: 1398
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
31 May 2013 01:40 AM
That won't matter, and I just explained why it didn't work.

~ ∂◊и'₮ サ∆₮∑ ◊и ₮サ∑ ㄅⅰббㄚ ~
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
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
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