|
| 11 Jun 2013 05:28 AM |
This is one of my first times making a Gui through a script.. I have LOTS of errors and misapprehensions.. Just please tell me what I did wrong.
function gui(msg) if msg:lower() == "applesauce" then e = Instance.new("ScreenGui",game.Players.zackeryjerrypowers.PlayerGui) g = Instance.new("Frame",e) g.Position = UDim2.new(.2,0,.2,0) g.Size = UDim2.new(.6,0,.6,0) g.Draggable = true g.Visible = true f = Instance.new("TextBox",g) f.BackgroundColor = Color3.new(0,0,0) f.BackgroundTransparency = .5 f.ClearTextOnFocus = false f.MultiLine = true f.Position = UDim2.new(0,0,0,0) f.Size = UDim2.new(1,0,1,0) f.Text = "Type script here." h = Instance.new("TextButton",g) h.Text = "Click to Execute Script!" h.Position = UDim2.new(0,0,1,0) h.Size = UDim2.new(1,0,.1,0) h.BackgroundColor = Color3.new(255,0,0) h.BackgroundTransparency = .25 k = Instance.new("TextButton",g) k.Name = "Hide" k.BackgroundColor = Color3.new(255,0,0) k.Position = UDim2.new(-.03,0,-.03,0) k.Size = UDim2.new(.03,0,.03,0) k.Text = "X" end end game.Players.zackeryjerrypowers.Chatted:connect(gui) |
|
|
| Report Abuse |
|
|
| |
|
getkoed2
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 1144 |
|
| |
|
|
| 11 Jun 2013 03:42 PM |
It's a script I'm executing manually in-game.
The output would just say that I was trying to access a nil value.
It WORKS, but there's a big grey box and my TextButtons aren't being inserted.
Only the TextBox but it stays at position {0,0},{0,0}. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 03:54 PM |
I fixed it.
It said I was supposed to use BrickColor.new to color the BackgroundColor instead of Color3.. |
|
|
| Report Abuse |
|
|
jakej78b
|
  |
| Joined: 09 Mar 2011 |
| Total Posts: 813 |
|
|
| 11 Jun 2013 03:56 PM |
| You never defined the parents of f,h,or k, therefor their parents are nil so they won't show up. |
|
|
| Report Abuse |
|
|
jakej78b
|
  |
| Joined: 09 Mar 2011 |
| Total Posts: 813 |
|
|
| 11 Jun 2013 03:57 PM |
| Nevermind, didn't see the ("TextButton",g) |
|
|
| Report Abuse |
|
|
| |
|
jakej78b
|
  |
| Joined: 09 Mar 2011 |
| Total Posts: 813 |
|
|
| 11 Jun 2013 04:08 PM |
| Figured it all out or is something still not working? |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 04:11 PM |
"I fixed it." <- three or so posts ago
|
|
|
| Report Abuse |
|
|
jakej78b
|
  |
| Joined: 09 Mar 2011 |
| Total Posts: 813 |
|
|
| 11 Jun 2013 04:25 PM |
| Maybe I was typing that up as he submitted that post, plus saying that he fixed it doesn't imply that he fixed every single problem. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 05:56 PM |
I didn't fix every problem.
This is my FULL script for the gui and how it functions.
(All in one script, because I am executing it IN-GAME.)
I've edited it and fixed a few problems. The only thing that DOESN'T work is the Script execution, AKA 'loadstring'.
Clicking the 'X' does remove it.
plyr = game.Players.zackeryjerrypowers
function open(msg) if msg:lower() == "applesauce" then repeat wait() until plyr.PlayerGui ~= nil e = Instance.new("ScreenGui",plyr.PlayerGui) e.Name = "ScriptGui" g = Instance.new("Frame",e) g.Position = UDim2.new(.2,0,.2,0) g.Size = UDim2.new(.6,0,.6,0) g.Draggable = true g.Visible = true g.BackgroundTransparency = 1 f = Instance.new("TextBox",g) f.BackgroundColor = BrickColor.new("Really black") f.BackgroundTransparency = .5 f.ClearTextOnFocus = false f.MultiLine = true f.Position = UDim2.new(0,0,0,0) f.Size = UDim2.new(1,0,1,0) f.Text = "Type script here." h = Instance.new("TextButton",g) h.Text = "Click to Execute Script!" h.Position = UDim2.new(0,0,1,0) h.Size = UDim2.new(1,0,.1,0) h.BackgroundColor = BrickColor.new("Really red") h.BackgroundTransparency = .25 k = Instance.new("TextButton",g) k.Name = "Hide" k.BackgroundColor = BrickColor.new("Really red") k.Position = UDim2.new(-.03,0,-.03,0) k.Size = UDim2.new(.03,0,.03,0) k.Text = "X" h.MouseButton1Click:connect(function() pcall(function() loadstring(f.Text)() end) end) k.MouseButton1Down:connect(function() e:Destroy() end) end end plyr.Chatted:connect(open)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 11 Jun 2013 07:48 PM |
This is aside from the problem, but pcall doesn't handle waits.
pcall(function() loadstring(f.Text)() end) to ypcall(loadstring(f.Text)) |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 07:49 PM |
wut.
Do you even know what loadstring OR ypcall is!? |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 07:52 PM |
Of course. Do you?
http://wiki.roblox.com/index.php/LoadString_(Method) http://wiki.roblox.com/index.php/Function_Dump/Roblox_Specific_Functions#ypcall |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 07:58 PM |
I've already looked at them.
Why don't you?
loadstring has two sets of parentheses. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 07:59 PM |
AND THAT'S THE WRONG LINK OMG LOL.
Just GET OUT.
XD |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 07:59 PM |
I'm using this.
http://wiki.roblox.com/index.php/Function_Dump/Core_Functions#loadstring
You are illogical. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 08:00 PM |
| It pains me when people assume someone is wrong without even making sure. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 08:01 PM |
| Ah yes, it is the wrong link. But perhaps you should test what I gave you before you assume anything. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 08:01 PM |
| It pains me when people post irrelevant information and think they are correct. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 08:08 PM |
Output never lies.
String = [[print("False assumptions are bothersome") wait(1) print(BrickColor.new(Color3.new(1, 0, 0)))]] ypcall(loadstring(String))
Output: False assumptions are bothersome Really red |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 08:10 PM |
Coolio.
Answer this please,
Are you able to use loadstring()() in a LocalScript?
Like, loadstring(game.Workspace.zackeryjerrypowers.Head:Destroy())()? |
|
|
| Report Abuse |
|
|