|
| 29 May 2015 07:37 PM |
I'm used to scratch (A very simple program to make games and such with basic code blocks) and I know they had a 'when green flag click' (How scripts were started in scratch) and was wondering if there was a similar script for Roblox's servers. If so, a reply would be appreciated :D.
|
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 29 May 2015 07:37 PM |
Ummmm... wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 07:38 PM |
| Never mind, stupid question. |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
| |
|
|
| 29 May 2015 08:01 PM |
Not a stupid question. No question is stupid.
I am writing this as if you are really new to Roblox, because I don't know what you are.
It depends on where the script is located, and what type of script it is. ModuleScripts run no matter where you put them, but only when another script calls the require function on it. ModuleScripts are places to store code that you can re-use and stuff. ModuleScripts run on whatever machine required them.
LocalScripts run anywhere local, such as inside Backpack, PlayerGui, PlayerScripts, the Character, Tools, HopperBins, etc. LocalScripts run on the client (The players' computers) and thus should be used for GUIs, anything that involves input, etc.
Scripts run almost anywhere, but not in Lighting, and not in a few other places. The best place for a Script is inside ServerScriptService, but in certain cases it might also be acceptable to put them inside of something in Workspace. In ServerScriptService, people cannot steal your scripts. Scripts do not go inside of PlayerGui, Backpack, Character, or any other local place. Yes, it is possible sometimes, but it is a bad practice. Scripts run on the server, and thus should be used to save/load data, send/receive data from websites, etc.
Backpack is where a player has his tools, and they are cloned in automatically from StarterPack. PlayerGui is where a player has his GUIs, and they are cloned in automatically from StarterGui. PlayerScripts is a new feature that is a more 'proper' place to run LocalScripts, but it is brand new, and currently unstable (And disabled I think) The Character is the Player's physical form, a Model inside Workspace. Tools are tools, HopperBins are tools that don't have Handles (They don't have physical parts)
Since you are new to Roblox Lua, I recommend you learn the client-server model ASAP, before you develop bad habits with it. The client-server model is the differences between the client and server, their limitations, how they interact, etc. If you need more detailed guidance on this, you can PM me or ask here. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:02 PM |
| Although I suppose there is such thing as a badly-worded question, but this isn't it. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:08 PM |
| Jarod, a lot of what you said about scripts is incorrect. |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 May 2015 08:14 PM |
>>Scripts run almost anywhere Really, the only places script run is anywhere in the workspace, ServerScriptService, or inside a Player(possibly only in their containers).
>>The best place for a Script is inside ServerScriptService Not necessarily. For the most part, you should put anything that interacts with the workspace in the workspace.
>>PlayerScripts is a new feature that is a more 'proper' place to run LocalScripts PlayerScripts is really only for localscripts you don't want to reset on death.
>>Scripts do not go inside of PlayerGui, Backpack, Character, or any other local place. Yes, it is possible sometimes, but it is a bad practice. That isn't true; scripts that handle the firing for weapons should go inside the Backpack/character and firing of weapons should always be done in normal scripts. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:17 PM |
>>Scripts run on the server, and thus should be used to save/load data, send/receive data from websites, etc. A better way to describe it is server-scripts should handle the game logic. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:24 PM |
"Really, the only places script run is anywhere in the workspace, ServerScriptService, or inside a Player(possibly only in their containers)." Okay, I didn't actually count. I just thought they did. I might have been thinking of the things inside Workspace. I guess it's just one of those subconscious ways of thinking.
"Not necessarily. For the most part, you should put anything that interacts with the workspace in the workspace." Since when? It works just as well, and is more organized and they can't be stolen, when you put them in ServerScriptService.
"PlayerScripts is really only for localscripts you don't want to reset on death." It is more proper, I assure you. We already have a place for GUIs, and a place for tools, and a place for Character-related stuff, so where do the uncategorized scripts go? You can easily make it reset on death in near five lines.
"scripts that handle the firing for weapons should go inside the Backpack/character" I don't know why you would put them there. LocalScripts are the only ones you would typically ever need there, unless you are making a Roblox gear where you can't simply reparent it when a user has it.
"firing of weapons should always be done in normal scripts." When did I ever say otherwise? :P
"a lot of what you said about scripts is incorrect." In order of responses in my current post: -Yes, it was incorrect. -Opinion. (Mine was opinion too, but it is what I (and people I think I know well) would do) -Opinion. (Mine was opinion too, but it is what I (and people I think I know well) would do) -You were right on this one too (But again, so was I; I never said nor implied otherwise) |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:35 PM |
>>It is more proper, I assure you. We already have a place for GUIs, and a place for tools, and a place for Character-related stuff, so where do the uncategorized scripts go? You can easily make it reset on death in near five lines.
That was exactly what I was saying, but how you said it it sounded like all localscripts should go in PlayerScripts
>>Since when? It works just as well, and is more organized and they can't be stolen, when you put them in ServerScriptService. So if you had a brick that kills on touch, you would prefer to make it much less organized and put the killing script in ServerScriptService just so it can't be stolen?
>>I don't know why you would put them there. LocalScripts are the only ones you would typically ever need there, unless you are making a Roblox gear where you can't simply reparent it when a user has it. It's a lot more organized to put the scripts in the tool IMO |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:36 PM |
>>I don't know why you would put them there. LocalScripts are the only ones you would typically ever need there, unless you are making a Roblox gear where you can't simply reparent it when a user has it.
And honestly, where else would you put them? |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:36 PM |
raw code in a server script should run when a server starts
// cpmoderator \\ INTJ personality // |
|
|
| Report Abuse |
|
|
xlaser23
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 20341 |
|
|
| 29 May 2015 08:44 PM |
Everyone went off topic........
He asked if roblox had a drag-and-drop scripting like
HourOfCode |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:46 PM |
hour of code is cancer tbh
// cpmoderator \\ INTJ personality // |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:47 PM |
| How is teaching people how to program cancer? |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:49 PM |
"And honestly, where else would you put them?" This might not be the most recent version, and the stuff in it is about a year old, from before I knew about FE and the client-server model and stuff like that, so expect glitches, but here you are: http://www.roblox.com/item.aspx?id=157229684 |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:49 PM |
"How is teaching people how to program cancer?" drag and drop is cancer it doesn't teach you anything about coding
// cpmoderator \\ INTJ personality // |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 08:50 PM |
@JarodOfOrbiter Doesn't explain where you'd put them. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 09:00 PM |
Yeah, in it I put them in ServerScriptService.
Oh, I forgot to make it open-source xD |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 09:08 PM |
@JarodOfOrbiter The grenade detonator isn't even enabled. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 09:33 PM |
Probably because I didn't put it in ServerStorage, and I still didn't want it running. It parents itself to the fired grenades. I don't like putting Scripts in Parts in Workspace, but it isn't too bad I guess. |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 09:40 PM |
"because I don't know what you are." Lol k
|
|
|
| Report Abuse |
|
|
|
| 29 May 2015 09:44 PM |
| Jarod's originally post here was actually correct. There are definitely best-practices in place, and his comments about "best places" to put things is correct. Trust me on that. I've been developing on Studio way longer than I ever should have :P |
|
|
| Report Abuse |
|
|