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: The output is trolling me! Plugin help.

Previous Thread :: Next Thread 
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 01:31 PM
--[[
Brick creator plugin.
Made by Tehepicford
]]

OnVal = false
CoreG = Game:GetService("CoreGui")

function On()

OnVal = true

plugin:Activate(true)

ScreenG = Instance.new("ScreenGui", CoreG)
ScreenG.Name = "BrickGP"

Frame = Instance.new("Frame", ScreenG)
Frame.Size = UDim2.new(1, 0, 0.2, 0)
Frame.Style = "RobloxRound"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size X"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.2, 0, 0.2, 0) -- X, Y
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "X"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size Y"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.5, 0, 0.2, 0)
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "Y"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size Z"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.8, 0, 0.2, 0)
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "Z"

end

function Off()
OnVal = false
CoreG:FindFirstChild("BrickGP"):Remove()
plugin:Activate(false) -- Deactivating the Plugin
end

local plugin = PluginManager():CreatePlugin()
local toolbar = plugin:CreateToolbar("Plugin brick")
local button = toolbar:CreateButton("Brick creator V1", "Brick creator", "IconImage.png")


button.Click:connect(function()
if OnVal == false then
On()
else
Off()

local mouse = plugin:GetMouse()
mouse.Button1Down:connect(function()
Brick = Instance.new("Part", Workspace)
Brick.Anchored = true
pcall(function() Brick.Size = CFrame.new(X, Y, Z) end)
Brick.Position = mouse.Hit.p
end)
end)



The error is somewhere between the mouse.Button1Down and the end.
I think, I have no idea what is wrong.
Please help!
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
18 May 2012 01:32 PM
What is the error?
Does anything happen?
Does nothing happen and you get no error?


PS: Size = Vector3 =/= CFrame
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 01:33 PM
19:33:06.691 - /Users/macuser/Documents/Roblox/plugins/TestPlugin/Script.lua:78: unexpected symbol near ')'
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
18 May 2012 01:35 PM
--[[
Brick creator plugin.
Made by Tehepicford
]]

OnVal = false
CoreG = Game:GetService("CoreGui")

function On()

OnVal = true

plugin:Activate(true)

ScreenG = Instance.new("ScreenGui", CoreG)
ScreenG.Name = "BrickGP"

Frame = Instance.new("Frame", ScreenG)
Frame.Size = UDim2.new(1, 0, 0.2, 0)
Frame.Style = "RobloxRound"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size X"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.2, 0, 0.2, 0) -- X, Y
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "X"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size Y"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.5, 0, 0.2, 0)
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "Y"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size Z"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.8, 0, 0.2, 0)
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "Z"

end

function Off()
OnVal = false
CoreG:FindFirstChild("BrickGP"):Remove()
plugin:Activate(false) -- Deactivating the Plugin
end

local plugin = PluginManager():CreatePlugin()
local toolbar = plugin:CreateToolbar("Plugin brick")
local button = toolbar:CreateButton("Brick creator V1", "Brick creator", "IconImage.png")


button.Click:connect(function()
if OnVal == false then
On()
else
Off()
end
end)

local mouse = plugin:GetMouse()
mouse.Button1Down:connect(function()
Brick = Instance.new("Part", Workspace)
Brick.Anchored = true
pcall(function() Brick.Size = CFrame.new(X, Y, Z) end)
Brick.Position = mouse.Hit.p
end)





You didn't close the Click connection. Well, you tried, but you were missing an end for the if statement.
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 01:41 PM
--[[
Brick creator plugin.
Made by Tehepicford
]]

OnVal = false
CoreG = Game:GetService("CoreGui")

function Create()
Brick = Instance.new("Part", Workspace)
Brick.Anchored = true
if pcall(function() Brick.Size = CFrame.new(X, Y, Z) end) then
print("No Error")
else
print("Error")
Brick.Position = mouse.Hit.p
end
end -- End function

function On()

OnVal = true

plugin:Activate(true)

ScreenG = Instance.new("ScreenGui", CoreG)
ScreenG.Name = "BrickGP"

Frame = Instance.new("Frame", ScreenG)
Frame.Size = UDim2.new(1, 0, 0.2, 0)
Frame.Style = "RobloxRound"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size X"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.2, 0, 0.2, 0) -- X, Y
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "X"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size Y"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.5, 0, 0.2, 0)
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "Y"

Size = Instance.new("TextBox", Frame)
Size.Text = "Size Z"
Size.Size = UDim2.new(0.2, 0, 0.3)
Size.Position = UDim2.new(0.8, 0, 0.2, 0)
Size.TextColor3 = Color3.new(1, 1, 1)
Size.BackgroundColor3 = Color3.new(0, 0, 0)
Size.Font = "Arial"
Size.FontSize = "Size14"
Size.Name = "Z"

end

function Off()
OnVal = false
CoreG:FindFirstChild("BrickGP"):Remove()
plugin:Activate(false) -- Deactivating the Plugin
end

local plugin = PluginManager():CreatePlugin()
local toolbar = plugin:CreateToolbar("Plugin brick")
local button = toolbar:CreateButton("Brick creator V1", "Brick creator", "IconImage.png")


button.Click:connect(function()
if OnVal == false then
On()
else
Off()
end
end)

local mouse = plugin:GetMouse()
mouse.Button1Down:connect(function()
Create()
end)


Got this, Same error -.-
Im not good with plugins ;P Its my first one.
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 01:46 PM
Bump.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
18 May 2012 01:48 PM
What line is the error on in the new script?
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 01:50 PM
78
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
18 May 2012 01:53 PM
I don't see anything wrong with it.
Are you sure you saved the correct file?
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 01:54 PM
Lol, I don't think I saved it at all, Lemme check.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
18 May 2012 01:55 PM
I do believe that would pose a problem. ;P
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 01:56 PM
Turns out I never did =P

But now, Dun dun dun!!!
I get this -.-
19:55:07.467 - /Users/macuser/Documents/Roblox/plugins/TestPlugin/Script.l:24: attempt to index global 'plugin' (a nil value)
19:55:07.468 - Script "/Users/macuser/Documents/Roblox/plugins/TestPlugin/Script.l", Line 24 - global On
19:55:07.469 - Script "/Users/macuser/Documents/Roblox/plugins/TestPlugin/Script.l", Line 78
19:55:07.470 - stack end
19:55:07.470 - Disconnected event because of exception

Is it because I used 'local' Ima try it without.
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 01:58 PM
Ok it works!

But now when I click my CPU rate, Just drops then Roblox crashes -.-
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
18 May 2012 01:58 PM

local plugin = PluginManager():CreatePlugin()
local toolbar = plugin:CreateToolbar("Plugin brick")
local button = toolbar:CreateButton("Brick creator V1", "Brick creator", "IconImage.png")


Just put that up at the top. Not sure if removing local from it will change anything. It might.
Report Abuse
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
18 May 2012 02:12 PM
Local makes it only readable in that function I think ;P
Outside that function it shall read it as nil.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
18 May 2012 02:48 PM
No.
Local just defines the scope.
It's kind of hard to explain.

If you place it outside the function (at the very top of the script) you won't have any problems.
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