|
| 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 |
|
|
|
| 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 |
|
|
|
| 18 May 2012 01:33 PM |
| 19:33:06.691 - /Users/macuser/Documents/Roblox/plugins/TestPlugin/Script.lua:78: unexpected symbol near ')' |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 18 May 2012 01:48 PM |
| What line is the error on in the new script? |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 May 2012 01:53 PM |
I don't see anything wrong with it. Are you sure you saved the correct file? |
|
|
| Report Abuse |
|
|
|
| 18 May 2012 01:54 PM |
| Lol, I don't think I saved it at all, Lemme check. |
|
|
| Report Abuse |
|
|
|
| 18 May 2012 01:55 PM |
| I do believe that would pose a problem. ;P |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 18 May 2012 01:58 PM |
Ok it works!
But now when I click my CPU rate, Just drops then Roblox crashes -.- |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|