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: Please point some stuff out?

Previous Thread :: Next Thread 
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
11 Jun 2013 03:35 PM
Bump..
Report Abuse
getkoed2 is not online. getkoed2
Joined: 11 Apr 2010
Total Posts: 1144
11 Jun 2013 03:40 PM
Output?
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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 is not online. 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 is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
11 Jun 2013 03:57 PM
Nevermind, didn't see the ("TextButton",g)
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
11 Jun 2013 03:58 PM
T-T
Report Abuse
jakej78b is not online. 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
civilizationfreak is not online. civilizationfreak
Joined: 11 Jul 2011
Total Posts: 7688
11 Jun 2013 04:11 PM
"I fixed it." <- three or so posts ago
Report Abuse
jakej78b is not online. 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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
11 Jun 2013 06:26 PM
Bump..
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
11 Jun 2013 07:43 PM
2Bump2
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
11 Jun 2013 07:49 PM
wut.

Do you even know what loadstring OR ypcall is!?
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
11 Jun 2013 07:58 PM
I've already looked at them.

Why don't you?

loadstring has two sets of parentheses.
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
11 Jun 2013 07:59 PM
AND THAT'S THE WRONG LINK OMG LOL.

Just GET OUT.

XD
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
11 Jun 2013 08:00 PM
It pains me when people assume someone is wrong without even making sure.
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
11 Jun 2013 08:01 PM
It pains me when people post irrelevant information and think they are correct.
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
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
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
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
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