of     1   

Jikati
#35090990Friday, October 08, 2010 5:49 PM GMT

How would I execute a script right after I write it, with a script, rather than having to cut and paste the script back in/disabling and then enabling script?
lilgibbz123
#35091241Friday, October 08, 2010 5:58 PM GMT

?
joshboy7797
#35092242Friday, October 08, 2010 6:27 PM GMT

??
Playrobot
#35092294Friday, October 08, 2010 6:28 PM GMT

I don't know if that's a roblox feature yet or not.
pwnedu46
#35102570Friday, October 08, 2010 9:34 PM GMT

You can't. This is because when you disable/enable a script, it re-compiles the _ENTIRE_ script. This compiling is an extremely important part of high-level programming languages (lua, C#, C, C++, J#, Java, Python, Basic, Basic.net, and many more). an illustration: http://www.roblox.com/How-a-compiler-works-item?id=36469883e
crazypotato4
#35102783Friday, October 08, 2010 9:36 PM GMT

loadstring( --script goes here )() that should work, but it's basically for stuff like chat >.< idk how to make what you want work...
AgentFirefox
Top 100 Poster
#35103170Friday, October 08, 2010 9:41 PM GMT

local Script = { new = function() return { Name = "Script", Parent = nil, Source = [[print("Hello, world")]], run = function(self) if self.Parent ~= nil then coroutine.wrap(function() getfenv()["script"] = self loadstring(self.Source)() end)() end end, copy = function(self) return { Name = self.Name, Parent = nil, Source = self.Source, run = self.run, copy = self.copy, delete = self.delete } end, delete = function(self) self = nil end } end } --Use local S = Script.new() S.Parent = workspace S.Source = [===[ --Source here! This is your script. ]===] --To run the script: S:run() --To copy the script: S:copy() --To delete the script: S:delete()
Legend26
#35103410Friday, October 08, 2010 9:44 PM GMT

You don't even need loadstring. (function () end)() ? ?? ???

    of     1