generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Plugin help - something wrong with mouse

Previous Thread :: Next Thread 
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
21 Jan 2013 12:10 PM
bump
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
21 Jan 2013 12:48 PM
bump D:
Report Abuse
gamert7 is not online. 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 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
21 Jan 2013 12:53 PM
Just kidding.
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
22 Jan 2013 07:11 AM
Help
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
22 Jan 2013 10:33 AM
bump, srsly does no-one know about plugins
Report Abuse
awas3 is not online. 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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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 is not online. 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
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
22 Jan 2013 11:35 AM
I tried it, same result
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image