A Roblox Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomeLatest imagesRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Top posters
blueymaddog
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
naknak
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
Supernapalm
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
m27frogy
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
slayer9365
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
myrco919
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
branefreez
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
ninga95
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
CloneTrooper787
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
raboy117
Roblox is stupid, so I'm posting a script here for anyone to fix. Vote_lcapRoblox is stupid, so I'm posting a script here for anyone to fix. Voting_barRoblox is stupid, so I'm posting a script here for anyone to fix. Vote_rcap 
Top posting users this month
No user
Latest topics
» Where to go from here.
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptySeptember 14th 2020, 1:20 pm by MrNicNac

» Send me an Email
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptySeptember 14th 2020, 1:16 pm by MrNicNac

» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJuly 6th 2015, 7:38 pm by m27frogy

» New Site Possibly
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJuly 6th 2015, 4:16 pm by m27frogy

» Ambassador!
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyApril 15th 2015, 11:40 pm by naknak

» Boop - Tag
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyApril 13th 2015, 9:46 pm by naknak

» Vip Class Script
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyApril 13th 2015, 4:54 pm by naknak

» Who's active?!
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyApril 13th 2015, 4:52 pm by naknak

» Genesis Point
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJuly 17th 2014, 7:04 pm by branefreez

» Reward System
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJuly 17th 2014, 5:41 am by m27frogy

» Script Request
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJuly 10th 2014, 11:43 am by naknak

» local scripts?
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJuly 10th 2014, 11:39 am by naknak

» Project: Reconstruction [Died]
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJuly 10th 2014, 11:36 am by naknak

» Hi. I am new here
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyApril 26th 2014, 4:01 pm by altshiftkey

» What's your favorite sport?
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJanuary 1st 2014, 2:13 pm by m27frogy

» FlashLight Script
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJanuary 1st 2014, 2:11 pm by m27frogy

» Gun Making! [READ DESC]
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyJanuary 1st 2014, 2:10 pm by m27frogy

» Hi, I am new here!
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyNovember 26th 2013, 3:33 pm by Keanu73

» Improve Coding
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyOctober 26th 2013, 1:12 pm by pook03

» Simple Button
Roblox is stupid, so I'm posting a script here for anyone to fix. EmptySeptember 1st 2013, 6:19 pm by branefreez


 

 Roblox is stupid, so I'm posting a script here for anyone to fix.

Go down 
3 posters
AuthorMessage
Guest
Guest
avatar



Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 12th 2011, 12:51 am

You may have been lead here because of my post on Roblox, or you may just be checking this site. I don't care. Here is what's wrong:


THE FUNCTION:

Code:
local function runScript(msg)
if string.sub(msg, 1, 4):lower() == string.lower("run/") then
print(msg:sub(5) .. " return 1")
local str = loadstring(string.sub(msg, 5) .. " return 1")
getfenv(str).print = OutputPrint -- a function I made
local stat, err = coroutine.resume(coroutine.create(str))
print(stat, err)
repeat wait() until not stat or err == 1 -- I'm still experimenting with this part, but I can't test it until I get the loadstring stuff fixed
print(stat, err)
if err == 1 then
script.Parent.Text = "It worked :D"
wait(3)
script.Parent.Text = "Output GUI"
else
script.Parent.Text = tostring(err)
end
end
end

runScript([[run/print("Hello") wait(1) error("wut")]])

THE OUTPUT:

Fri Mar 11 23:43:13 2011 - [string "print("Hello") wait(1) error("wut") return ..."]:1: wut
Fri Mar 11 23:43:13 2011 - [string "print("Hello") wait(1) error("wut") return 1"], line 1 stack end

I've been trying to fix my SB, 'cause ever since I switched it from pcall to coroutines, it just didn't work. Obviously, the error is coming from the loadstring stuff, but I don't understand why, since coroutine.resume is supposed to run stuff in protected mode ._.

HALP.
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 25

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 14th 2011, 5:46 am

I've modified part of it and it might work:

local function runScript(msg)
if string.sub(msg, 1, 4):lower() == string.lower("run/") then
print(msg:sub(5))
local stat, err = loadstring(string.sub(msg, 5))
print(stat, err)
if not err then
script.Parent.Text = "It worked :D"
wait(3)
script.Parent.Text = "Output GUI"
else
script.Parent.Text = err
end
end
end

runScript([[run/print("Hello") wait(1) error("wut")]])
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 25

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 14th 2011, 5:48 am

and the error message that was in the output before was because you used the function 'error' to print 'wut' as an error message.
Back to top Go down
Guest
Guest
avatar



Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 16th 2011, 5:30 pm

@Bluey: I'm using coroutines because they should run in protected mode (kinda like pcall). I highly doubt that your "solution" would work :o

But without this, my SB will never be fixed D:
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 16th 2011, 9:03 pm

You couldn't just take all the code out of the function, adjust it to still work, and then run it to find out what line(s) was wrong? I would, but I don't have enough time right now.
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 25

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 17th 2011, 6:42 am

I think your's works actually! noticed how you used the error() function instead of print()?
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 17th 2011, 9:05 pm

Error is fun?
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 25

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 18th 2011, 4:32 pm

I'm just changing 1 function:

local function runScript(msg)
if string.sub(msg, 1, 4):lower() == string.lower("run/") then
print(msg:sub(5) .. " return 1")
local str = loadstring(string.sub(msg, 5) .. " return 1")
getfenv(str).print = OutputPrint -- a function I made
local stat, err = coroutine.resume(coroutine.create(str))
print(stat, err)
repeat wait() until not stat or err == 1 -- I'm still experimenting with this part, but I can't test it until I get the loadstring stuff fixed
print(stat, err)
if err == 1 then
script.Parent.Text = "It worked :D"
wait(3)
script.Parent.Text = "Output GUI"
else
script.Parent.Text = tostring(err)
end
end
end

runScript([[run/print("Hello") wait(1) print("wut")]])
Back to top Go down
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 19th 2011, 11:26 am

But error is fun D:
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 25

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 20th 2011, 1:13 am

'[string "print("Hello") wait(1) error("wut") return ..."]:1: wut'
that is the output that is meant to to happen because of this: 'error("wut")'
Back to top Go down
Supernapalm
Expert Scripter
Expert Scripter
avatar


Posts : 393
Join date : 2011-01-17

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 20th 2011, 11:11 pm

hmmm. sigh* do strings in lua have to be that complicated?
Back to top Go down
http://hackthissite.org
naknak
Administrator
Administrator
naknak


Posts : 878
Join date : 2010-07-30

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 22nd 2011, 7:31 am

Yes, they do. For some reason, they do.
Back to top Go down
blueymaddog
Administrator
Administrator
blueymaddog


Posts : 1081
Join date : 2010-12-09
Age : 25

Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. EmptyMarch 25th 2011, 6:35 am

*rage* THE PROBLEM HAS NOTHING TO DO WITH STRINGS. if you look up the function error() on wiki it'll tell you that it makes error messages in the output.
Back to top Go down
Sponsored content





Roblox is stupid, so I'm posting a script here for anyone to fix. Empty
PostSubject: Re: Roblox is stupid, so I'm posting a script here for anyone to fix.   Roblox is stupid, so I'm posting a script here for anyone to fix. Empty

Back to top Go down
 
Roblox is stupid, so I'm posting a script here for anyone to fix.
Back to top 
Page 1 of 1
 Similar topics
-
» Roblox Language
» Roblox AI
» Roblox Ad Gui
» Roblox Wiki?
» Roblox Private Server Creator

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Questions and Help :: Scripting-
Jump to: