|
| 12 Aug 2011 09:30 PM |
I'm trying to make a plug-in where it will add a team for you when clicked (I'm NEW to scripting, so I'm doing something simple). I just want to edit the demo's LUA file, but after I edit it, it won't let me save the changes. This is the script:
self = PluginManager():CreatePlugin() toolbar = self:CreateToolbar("Demos") button = toolbar:CreateButton("", "Add a Team", "plusmark.png")
button.Click:connect(function() Instance.new("Team", game.Teams) end)
Can anyone help me? |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Aug 2011 09:34 PM |
button.MouseButton1Click:connect(function() -- fixed this Instance.new("Team", game.Teams) end) |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2011 09:36 PM |
| @chiken: What? It was right before. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 09:36 PM |
So it should look like this?
self = PluginManager():CreatePlugin() toolbar = self:CreateToolbar("Demos") button = toolbar:CreateButton("", "Add a Team", "plusmark.png")
button.MouseButton1Click:connect(function() Instance.new("Team", game.Teams) end) |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2011 09:37 PM |
| @OP: You have to clear the read-only flag. That is, create another Lua file instead of editing that one. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 09:37 PM |
| Sorry, I'm used to rbx.lua, for all i know .Click could be valid in reg lua. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 09:37 PM |
| No no My computer won't let me save a CHANGE to it. Maybe because it's a LUA file? |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2011 09:37 PM |
| NO, THE BUTTON OBJECT has the Click event. Why are you thinking of GuiButtons? |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2011 09:38 PM |
| I know your computer won't save it. It's because it's read-only. Create another folder and put your file in there. |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 09:38 PM |
| Will you tell me how to create a LUA file? |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2011 09:38 PM |
| I'll write it on the wiki and post when I'm done. |
|
|
| Report Abuse |
|
|
Bannana97
|
  |
| Joined: 22 Jun 2008 |
| Total Posts: 10215 |
|
| |
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 12 Aug 2011 09:39 PM |
Didn't have to. Look at the blog post and/or look here:
http://wiki.roblox.com/index.php/How_To_Make_Plugins |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2011 09:40 PM |
@Bannana
Ok.. D;
*loses 9000 self esteem points* |
|
|
| Report Abuse |
|
|