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
 

Dunno what to call this thread. Help?

Previous Thread :: Next Thread 
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 09:24 PM
I'm trying to set some GUI up so that when I edit a text box, and then click a button, whatever was in the text box is set as an IntValue. Im having trouble with the onClicked function, and setting the IntValue.
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 09:25 PM
b1
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
23 Apr 2014 09:25 PM
What code do you have so far?
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 09:30 PM
I'm trying to post it, but it's being blocked for some reason. I'll try to PM it.
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 09:31 PM
Im pretty sure some of it doesn't need to be there. I'm new at scripting.
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
23 Apr 2014 09:32 PM
Easy..
Put this in a ServerScript inside the GUI:
script.Parent.Changed:connect(function()
local val==script.Parent.Text
local int=DefineThisAsYourIntValue
int.Value=val
end)
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 09:33 PM
You might have guessed I was making a TV, by the script.
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 09:39 PM
@imacheeseburger
I tried that, it doesn't seem to work, even though it looks like it should. Now I'm just stumped.
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 09:41 PM
b2
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 10:02 PM
I guess this thread died. Last bump of hope.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
23 Apr 2014 10:04 PM
Where is the IntValue?
Where is the TextBox?
Where is the Button?


Also, have you ever heard of FilteringEnabled? If not, you won't have to worry about it.

You'll HAVE to use a LocalScript to handle the GUI events.
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 10:13 PM
val = script.Parent.Text
int = Game.Workspace.Model.Screen.Channel
Button = script.Parent

Button.MouseButton1Click:connect(function()
int.Value = val
end)
Updated script (it's in a Local script)
IntValue is in game.Workspace.Model.Screen, it's called Channel.
TextBox is in StarterGui.ScreenGui.Frame
Button is in StarterGui.ScreenGui.Frame
Script is inside of the button.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
23 Apr 2014 10:17 PM
Then the text box would be somewhere else.
Also, is the TextBox named 'Text' ?


box = script.Parent.Parent:FindFirstChild("Text")
int = Game.Workspace.Model.Screen.Channel
Button = script.Parent

Button.MouseButton1Click:connect(function()
int.Value = box.Text
end)



You cannot associate a variable to a property, only the value the property contains. This may be kind of confusing right now, but hopefully, yhis example will clear it up:


local p = Instance.new("Part")

local n = p.Name
p.Name = "Bob"
print( n )
--> Part

print( p.Name )
--> Bob


Essentially, the value of all properties of all objects are copied to the variable. This means the variable will NOT change when the property is changed (because the VALUE was copied at the time of retrieval).
Report Abuse
typicalTOPHAT is not online. typicalTOPHAT
Joined: 25 Feb 2013
Total Posts: 66
23 Apr 2014 10:23 PM
Thank you very much, thank you for explaining that to me. It's working fine.
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