|
| 21 Jan 2013 11:26 AM |
This is my plugin. Its supposed to spawn parts where you click once activated. However, When I click the plugin, it doesn't stay activated, it only fires once, which doesn't let me spawn any parts.
local plugin = PluginManager():CreatePlugin() local mouse = plugin:GetMouse() local toolbar = plugin:CreateToolbar("EntityInsert") local pluginMode = "player_spawn" local button = toolbar:CreateButton( "Entity Plugin", "Used for placing entities", "icon.png" ) button.Click:connect(function() print("Navmesh Plugin activated.") print([[Entity list: ai_node player_spawn]]) end)
function _G.MODE(mode) pluginMode = mode end
function create_entity(ent, pos) if ent == "ai_node" then local p = Instance.new("Part") p.Name = ent p.CFrame = CFrame.new(hit) p.Anchored = true p.CanCollide = false p.Size = Vector3.new(1,1,1) p.BrickColor = BrickColor.new("Lime green") elseif ent == "player_spawn" then local p = Instance.new("Part") p.Name = ent p.CFrame = CFrame.new(hit) p.Anchored = true p.CanCollide = false p.Size = Vector3.new(2,1,2) p.BrickColor = BrickColor.new("Lime green") else print("Invalid entity") end end mouse.Button1Down:connect(function() local hit = mouse.Hit create_entity(pluginMode, CFrame.new(hit)) end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
gamert7
|
  |
| Joined: 18 Nov 2008 |
| Total Posts: 4986 |
|
|
| 21 Jan 2013 12:52 PM |
| Looks like another attempt to enter explorer into a online game. |
|
|
| Report Abuse |
|
|
gamert7
|
  |
| Joined: 18 Nov 2008 |
| Total Posts: 4986 |
|
| |
|
| |
|
|
| 22 Jan 2013 10:33 AM |
| bump, srsly does no-one know about plugins |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 22 Jan 2013 10:46 AM |
I dont think this will help but change:
p.CFrame = CFrame.new(hit)
to
p.CFrame = pos
~A3~ |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2013 11:14 AM |
| I know I fixed that, and its about plugin selection anyway, no errors after CFrame fix |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 22 Jan 2013 11:18 AM |
Add all the code at the bottom inside the
button.Click:connect(function()
end)
The code is outside the button function, when you click the button, all it will do is print, it will run the code outside but nothing will happen.
~A3~ |
|
|
| Report Abuse |
|
|
| |
|