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

Previous Thread :: Next Thread 
me6666me is not online. me6666me
Joined: 30 Aug 2011
Total Posts: 698
01 Jul 2013 08:58 AM
Btw, Don't "TL;DR" me, if you didn't read it then Get out...Nobody needs to know you suck at reading things.

Output -
08:51:02.832 - Frame is not a valid member of ScreenGui
08:51:02.833 - Script "C:/Users/me6666me/AppData/Local/Roblox/Plugins/TerrainGenerat", Line 353
08:51:02.835 - stack end
08:51:02.836 - Disconnected event because of exception


Info - I can click it the first time and all of it shows up, but when I click it again the whole script brakes!


local pluginManager = PluginManager()
local plugin = pluginManager:CreatePlugin()
local toolbar = plugin:CreateToolbar("My_Plugins")
local button = toolbar:CreateButton("Terrain Generator", "Opens a GUI that lets you control the variables of the terrain", "")
local mouse = plugin:GetMouse()
local on = false
waterTrueOrNot = true
TheMapsSize = 1
button.Click:connect(function()
button:SetActive(on)
on = not on
local main = game.CoreGui
if main:FindFirstChild("TerrainGeneratorGUI") then
main:FindFirstChild("TerrainGeneratorGUI"):destroy()
else
wait()
item = Instance.new("ScreenGui", main)
item.Name = "TerrainGeneratorGUI"
frame = Instance.new("Frame", item)
frame.Size = UDim2.new(.2,0,.3,0)
frame.Name = "Frame"
frame.Style = "RobloxRound"
btns = Instance.new("Frame", frame)
btns.Name = "Buttons"
btns.Size = UDim2.new(1,0,.3,0)
btns.Style = "RobloxSquare"
btns.Position = UDim2.new(0,0,.3,0)
btns.ZIndex = 2
addBtn = Instance.new("TextButton", btns)
addBtn.Name = "AddButton"
addBtn.Size = UDim2.new(.1,0,.5,0)
addBtn.Style = "RobloxButton"
addBtn.ZIndex = 3
subBtn = Instance.new("TextButton", btns)
subBtn.Name = "SubtractButton"
subBtn.Style = "RobloxButton"
addBtn.Text = "+"
subBtn.Text = "-"
subBtn.Size = UDim2.new(.1,0,.5,0)
subBtn.Position = UDim2.new(0,0,.5,0)
wa = Instance.new("TextButton", btns)
wa.Style = "RobloxButton"
wa.Name = "Water"
wa.Size = UDim2.new(.1,0,.5,0)
wa.Position = UDim2.new(.75,0,.45,0)
lab1 = Instance.new("TextLabel", wa)
lab1.Position = UDim2.new(.5,0,-3,0)
wa.Text = "X"
lab1.Text = "Water"
lab1.FontSize = "Size12"
lab1.Name = "Label"
wa.FontSize = "Size11"
subBtn.FontSize = "Size14"
addBtn.FontSize = "Size14"
lab1.TextColor3 = Color3.new(200,200,200)
wa.TextColor3 = Color3.new(200,200,200)
subBtn.TextColor3 = Color3.new(200,200,200)
addBtn.TextColor3 = Color3.new(200,200,200)
wa.ZIndex = 3
lab1.ZIndex = 4
lab2 = Instance.new("TextLabel", btns)
lab2.ZIndex = 3
lab2.Text = "Size : 1-6"
lab2.FontSize = "Size18"
lab2.Font = "ArialBold"
lab2.TextColor3 = Color3.new(200,200,200)
lab2.Position = UDim2.new(.325,0,.1,0)
lab2.Name = "Label"
num = Instance.new("TextLabel", btns)
num.Position = UDim2.new(.125,0,.5,0)
num.Size = UDim2.new(.4,0,.55,0)
num.TextColor3 = Color3.new(200,200,200)
num.ZIndex = 3
num.FontSize = "Size8"
num.Text = "1"
biomeBtn = Instance.new("TextButton", frame)
biomeBtn.Position = UDim2.new(.5,0,0,0)
biomeBtn.Size = UDim2.new(.5,0,.1,0)
biomeBtn.Name = "Biome"
biomeBtn.Text = "Camo"
biomeBtn.FontSize = "Size14"
biomeBtn.TextColor3 = Color3.new(200,200,200)
biomeBtn.BackgroundColor3 = Color3.new(0,0,0)
biomeBtn.BorderColor3 = Color3.new(200,200,200)
biomeBtn.ZIndex = 2
gen = Instance.new("TextButton", frame)
gen.ZIndex = 2
gen.TextColor3 = Color3.new(200,200,200)
gen.Size = UDim2.new(.75,0,.3,0)
gen.Position = UDim2.new(.125,0,.7,0)
gen.Text = "Generate"
gen.FontSize = "Size24"
gen.Font = "ArialBold"
gen.Name = "GenerateButton"
gen.Style = "RobloxButtonDefault"
gen.Selected = true
ic = Instance.new("TextButton", frame)
ic.Position = UDim2.new(.9,0,.85,0)
ic.Size = UDim2.new(.125,0,.15,0)
ic.Style = "RobloxButton"
ic.ZIndex = 2
ic.FontSize = "Size14"
ic.Text = "?"
ic.Name = "Icon"
ic.BorderColor3 = Color3.new(200,200,200)
lab3 = Instance.new("TextLabel", frame)
lab3.Name = "TextLabel"
lab3.Position = UDim2.new(.5,0,.2,0)
lab3.ZIndex = 2
lab3.Font = "ArialBold"
lab3.FontSize = "Size18"
lab3.Text = "Terrain Generator by me6666me"
lab3.TextColor3 = Color3.new(200,200,200)
frame2 = Instance.new("Frame", item)
frame2.Name = "HelpAndAboutFrame"
frame2.Style = "RobloxRound"
frame2.Size = UDim2.new(.4,0,.4,0)
frame2.Position = UDim2.new(0,0,.5,0)
frame2.Visible = false
lab4 = Instance.new("TextLabel", frame2)
lab4.Name = "LuaLearners"
lab4.Text = "LuaLearners Profile ID - 6720"
lab4.FontSize = "Size18"
lab4.Font = "ArialBold"
lab4.TextColor3 = Color3.new(200,200,200)
lab4.Position = UDim2.new(.5,0,.85,0)
lab4.ZIndex = 2
lab5 = Instance.new("TextLabel", frame2)
lab5.Name = "Twitter"
lab5.Text = "Twitter - http://www.twitter.com/me6666me"
lab5.FontSize = "Size18"
lab5.Font = "ArialBold"
lab5.TextColor3 = Color3.new(200,200,200)
lab5.Position = UDim2.new(.5,0,.75,0)
lab5.ZIndex = 2
lab6 = Instance.new("TextLabel", frame2)
lab6.Name = "Main"
lab6.Text = "Hello and thank you for using my plugin! All you really need to do is set whether or not there will be water, The size of the Biome, and the Color of each brick, then press Generate, Its simple as that! ~me6666me"
lab6.FontSize = "Size14"
lab6.Font = "ArialBold"
lab6.TextColor3 = Color3.new(200,200,200)
lab6.Position = UDim2.new(0,0,0)
lab6.ZIndex = 2
lab7 = Instance.new("TextLabel", frame2)
lab7.Name = "Roblox"
lab7.Text = "Roblox User ID - 19652620"
lab7.FontSize = "Size18"
lab7.Font = "ArialBold"
lab7.TextColor3 = Color3.new(200,200,200)
lab7.Position = UDim2.new(.5,0,.95,0)
lab7.ZIndex = 2
lab8 = Instance.new("TextLabel", frame2)
lab8.Name = "Youtube"
lab8.Text = "Youtube - http://www.youtube.com/me6666me2"
lab8.FontSize = "Size18"
lab8.Font = "ArialBold"
lab8.TextColor3 = Color3.new(200,200,200)
lab8.Position = UDim2.new(.5,0,.65,0)
lab8.ZIndex = 2
repeat wait() until item.Parent == main
repeat wait() until item.Frame ~= nil
function clk()
if item.Frame.Buttons.Water.Text == "" then
item.Frame.Buttons.Water.Text = "X"
waterTrueOrNot = true
elseif item.Frame.Buttons.Water.Text == "X" then
item.Frame.Buttons.Water.Text = ""
waterTrueOrNot = false
end end
item.Frame.Buttons.Water.MouseButton1Click:connect(clk)
function clk1()
if item.Frame.Buttons.Number.Value.Value>= 6 then
TheMapsSize = item.Frame.Buttons.Number.Value.Value
return
elseif item.Frame.Buttons.Number.Value.Value< 6 and
item.Frame.Buttons.Number.Value.Value> 0 then
item.Frame.Buttons.Number.Value.Value = item.Frame.Buttons.Number.Value.Value+1
item.Frame.Buttons.Number.Text = item.Frame.Buttons.Number.Value.Value
TheMapsSize = item.Frame.Buttons.Number.Value.Value
end end
item.Frame.Buttons.AddButton.MouseButton1Click:connect(clk1)
function clk2()
if item.Frame.Buttons.Number.Value.Value<= 0 then
TheMapsSize = item.Frame.Buttons.Number.Value.Value
return
elseif item.Frame.Buttons.Number.Value.Value<= 6 and
item.Frame.Buttons.Number.Value.Value> 1 then
item.Frame.Buttons.Number.Value.Value = item.Frame.Buttons.Number.Value.Value-1
item.Frame.Buttons.Number.Text = item.Frame.Buttons.Number.Value.Value
TheMapsSize = item.Frame.Buttons.Number.Value.Value
end end
item.Frame.Buttons.SubtractButton.MouseButton1Click:connect(clk2)
function clk3()
if item.HelpAndAboutFrame.Visible == true then
item.HelpAndAboutFrame.Visible = false
elseif item.HelpAndAboutFrame.Visible == false then
item.HelpAndAboutFrame.Visible = true
end end
item.Frame.Icon.MouseButton1Click:connect(clk3)
--Now for the bigger Part!
function clickMain()
repeat wait() until main.TerrainGeneratorGUI.Frame.Buttons.AddButton~=nil
Bricks_Color = item.Frame.Biome.Text
size = TheMapsSize
water = waterTrueOrNot
PosX = 1000
PosZ = 1000
NOB = PosX/3
NOB = NOB/1.5
if size == 1 then
PosX = 100
NOB = NOB/1.5
elseif size == 2 then
PosX = 350
NOB = NOB-15
elseif size == 3 then
PosX = 650
elseif size == 4 then
PosX = 800
elseif size == 5 then
PosX = 1000
elseif size == 6 then
PosX = 1500
end
PosZ = PosX
MinSizeX = PosX/6
MinSizeY = PosX/PosX
MinSizeZ = PosX/6
MaxSizeX = PosZ/6
MaxSizeY = PosZ/13
MaxSizeZ = PosZ/6
waterHeight = MaxSizeY*MinSizeY/MaxSizeY*1.25
msg = Instance.new("Message", workspace)
a = Instance.new("Model",workspace)
a.Name = math.random(1,99999999)
par = Instance.new("Model", a)
par.Name = "GeneratedBricks"
base = Instance.new("Part", a)
base.Locked = false
base.Name = "Base"
Mult1 = PosX+PosZ
Mult2 = Mult1/2
Mult3 = Mult2/100
Mult = Mult3*10
base.Size = Vector3.new(PosX+Mult, PosX/PosX+3, PosZ+Mult)
base.CFrame = CFrame.new(PosX/2, -5, PosZ/2)
base.Anchored = true
base.Transparency = 1
base.FormFactor = "Symmetric"
base.BrickColor = BrickColor.new(Bricks_Color)
base.TopSurface = "Smooth"
base.BottomSurface = "Smooth"
waterz = Instance.new("Part", a)
waterz.Locked = false
waterz.Transparency = 1
averageForX1 = MinSizeX+MaxSizeX
averageForX = averageForX1/2
averageForY1 = MinSizeX+MaxSizeY
averageForY = averageForY1/2
averageForZ1 = MinSizeX+MaxSizeZ
averageForZ = averageForZ1/2
if water == true then
PosZ = PosX
base.Size = base.Size-Vector3.new(0,3,0)
waterz.Name = "Water"
waterz.BrickColor = BrickColor.new("Bright blue")
waterz.Position = base.Position
waterz.Size = base.Size
waterz.Anchored = true
waterz.TopSurface = "Smooth"
waterz.BottomSurface = "Smooth"
waterz.CanCollide = true
NOB = NOB-NOB/10
if size == 5 then
NOB = NOB/2
elseif size == 4 then
NOB = NOB/1.25
elseif size == 3 then
NOB = NOB/1.15
else
end
else end
msg.Text = ("Average Size for each brick : "..averageForX..", "..averageForY..", "..averageForZ.." <")
print(msg.Text)
wait(2)
msg.Text = ("Base height : "..base.Size.y)
print("Base height : "..base.Size.y)
if water == true then
wait(1)
msg.Text = ("Generate water : true <")
wait(1)
msg.Text = ("Water height : "..waterz.Size.y)
print("Generate water : true <")
print("Water height : "..waterz.Size.y)
elseif water == false then
wait(1)
print("Generate water : false <")
msg.Text = ("Generate water : false <")
end
wait(1)
msg.Text = ("Region : "..PosX..", 0, "..PosZ.." <")
print("Region : "..PosX..", 0, "..PosZ.." <")
wait(1)
msg.Text = ("Bricks to generate: "..NOB.." <")
print("Bricks to generate: "..NOB.." <")
wait(1)
msg.Text = ("Directory : "..par.Parent.Parent.Parent.Name.." > "..par.Parent.Parent.Name.." > "..par.Parent.Name.." > "..par.Name.." <")
print("Directory : "..par.Parent.Parent.Parent.Name.." > "..par.Parent.Parent.Name.." > "..par.Parent.Name.." > "..par.Name.." <")
wait(1)
msg.Text = "Generating in : 3"
print(msg.Text)
wait(1)
msg.Text = "Generating in : 2"
print(msg.Text)
wait(1)
msg.Text = "Generating in : 1"
print(msg.Text)
wait(1)
msg.Text = ""
print(msg.Text)
if water==true then
waterz.Transparency = .5
else
end
base.Transparency = 0
for i = 1,NOB do
if msg == nil then return
else
wait()
local b = Instance.new("Part", a.GeneratedBricks)
brks = a.GeneratedBricks:GetChildren()
b.Anchored = true
b.TopSurface = "Smooth"
b.BottomSurface = "Smooth"
b.Name = "Generated Brick"
b.Size = Vector3.new(math.random(MinSizeX, MaxSizeX),math.random(MinSizeY, MaxSizeY),math.random(MinSizeZ, MaxSizeZ))
b.CFrame = CFrame.new(math.random(1,PosX), base.Position.y+1, math.random(1,PosZ))
b.BrickColor = BrickColor.new(Bricks_Color)
msg.Text = "Generated Bricks:"..#brks
print("Generated brick number : "..#brks)
end end
if #brks>=NOB or
#brks>=NOB-1 then
print("Generated brick number : "..#brks+1)
msg.Text = "Finished!"
print(msg.Text)
wait(3)
msg:remove()
else wait()
end
end
end
item.Frame.GenerateButton.MouseButton1Click:connect(clickMain)
end)
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
01 Jul 2013 09:07 AM
tl;dr
Report Abuse
Geodesic is not online. Geodesic
Joined: 02 Jun 2013
Total Posts: 998
01 Jul 2013 09:07 AM
tl;dr
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
01 Jul 2013 09:11 AM
@OP

It says the Frame isn't there, so make sure everything is properly placed. Also, could you give us the line the output gave?

@Others

At least he supplied us with an output for a lead. Don't be rude and specifically do what he asked us not to, or don't post at all.
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
01 Jul 2013 09:12 AM
it is line 353
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
01 Jul 2013 09:14 AM
I meant the actual line of code.
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
01 Jul 2013 09:15 AM
I think I maybe found the problem


on line 14, the gui gets removed with the frame named "Frame" this cause that "Frame" is equal to nil and will return in an error
Report Abuse
me6666me is not online. me6666me
Joined: 30 Aug 2011
Total Posts: 698
01 Jul 2013 09:16 AM
Yes but Im trying to find out a way to fix it, I found it out a bit after I posted this
Report Abuse
me6666me is not online. me6666me
Joined: 30 Aug 2011
Total Posts: 698
01 Jul 2013 09:18 AM
Line 14 Generates the Error
Report Abuse
me6666me is not online. me6666me
Joined: 30 Aug 2011
Total Posts: 698
01 Jul 2013 09:18 AM
In The code
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
01 Jul 2013 09:19 AM
Why do you want to remove it?
Report Abuse
me6666me is not online. me6666me
Joined: 30 Aug 2011
Total Posts: 698
01 Jul 2013 09:20 AM
It's In the Core GUI, If I didnt remove it then I wouldn't be able to re-create it each time it was clicked
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
01 Jul 2013 09:21 AM
but you can hide it by using the property Visible, then you will not need to remove it
Report Abuse
me6666me is not online. me6666me
Joined: 30 Aug 2011
Total Posts: 698
01 Jul 2013 09:23 AM
Actually I have an Idea
Report Abuse
me6666me is not online. me6666me
Joined: 30 Aug 2011
Total Posts: 698
01 Jul 2013 09:23 AM
Im going to pretty much re-write it, Im going to create the GUI before the button is clicked, making it Visible/Invisible when it is clicked
Report Abuse
me6666me is not online. me6666me
Joined: 30 Aug 2011
Total Posts: 698
01 Jul 2013 09:26 AM
Ok its fixed


THREAD CLOSED
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
01 Jul 2013 09:51 AM
tl

dr
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