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: math.ranodm + guis

Previous Thread :: Next Thread 
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 06:14 PM
is this right?



local Positions = {"0,.25","0.50","0,75","0,1"}
player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect (function () -- gui connection
player.PlayerGUI.ScreenGui.Frame.Textbutton.Position = UDim2.new (0,1,0,1) -- UDim is how to make a new position/size, just like Vector3, except it's 2 cordinate graphs, also 0,0 is on the top right, not top left!
player.PlayerGUI.ScreenGui.Frame.Textbutton.Position (math.random (0,1),math.random(0,1),math.random(0,1),math.random(0,1))
player.PlayerGUI.ScreenGui.Frame.Textbutton.Position (math.random [#Positions])
end)

please fix
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Nov 2013 06:14 PM
no
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Nov 2013 06:15 PM
(Oops, was referring to "is this right?")
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 06:15 PM
ok, how can i make it right? lol
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
26 Nov 2013 06:16 PM
I don't even know where to begin.

Could I suggest you start with something simpler, because you obviously have not grasped the basics of Lua yet to be able to move onto something as 'advanced' as this.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 07:42 PM
Get out, idiot!
I'm asking for help, not discouragment.

Anyways, I guess it's to advanced for you to answer, I understand
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 07:45 PM
Please help someone.
I think it hhs to do with

player.PlayerGUI

and the math.random


so eplase help
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 08:03 PM
Help!
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
26 Nov 2013 08:06 PM
player.PlayerGUI.ScreenGui.Frame.Textbutton.Position (math.random (0,1),math.random(0,1),math.random(0,1),math.random(0,1))

Look at it.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
26 Nov 2013 08:06 PM
1. It's PlayerGui, not PlayerGUI.
2. No = sign
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
26 Nov 2013 08:08 PM
local Positions = {"0,.25","0.50","0,75","0,1"}

not sure if some of the commas were on purpose or not
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
26 Nov 2013 08:09 PM
player.PlayerGUI.ScreenGui.Frame.Textbutton.Position (math.random [#Positions])

Again, no = sign.

You also called a function incorrectly.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 08:16 PM
wahts this suppposed to mean:

no = sign.
Report Abuse
Greendolph is not online. Greendolph
Joined: 07 May 2008
Total Posts: 2543
26 Nov 2013 08:19 PM
no = sign means you don't have an equals mark where there is supposed to be one.

You need "=" to assign values.

http://wiki.roblox.com/index.php/Absolute_beginner%27s_guide_to_scripting
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 08:48 PM
the way he worded it, AND im not a absolute begiginer
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 08:53 PM
how should I call that function?
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 09:02 PM
LOL I forgot for a few of them, so u call me an absolute beginner? What da heck
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
26 Nov 2013 09:11 PM
local Positions = {"0.25","0.50","0.75","0.1"}
player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function () -- gui connection
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = UDim2.new(0,1,0,1) -- 0,0,0,0 starts at top left corner
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = (math.random(0,1),math.random(0,1),math.random(0,1),math.random(0,1))
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = (math.random(1,#Positions))
end)
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 09:11 PM
local Positions = {"0,.25","0.50","0,75","0,1"}
player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect (function () -- gui connection
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = UDim2.new (0,1,0,1) -- UDim is how to make a new position/size, just like Vector3, except it's 2 cordinate graphs, also 0,0 is on the top right, not top left!
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = UDim2.new (math.random (0,1),math.random(0,1),math.random(0,1),math.random(0,1))
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = UDim2.new (math.random [#Positions])
end)

I know that last part is broken!
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Nov 2013 09:13 PM
What do you mean by:
local Positions = {"0,.25","0.50","0,75","0,1"}
?

As in, 0,.25 and 0,.50? Or?
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 09:16 PM
lol, when did those get there?

local Positions = {"0.25","0.50","0.75","0.1"}
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 09:17 PM
How do I fix the last part is my question! the math.random from the table
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Nov 2013 09:18 PM
Positions[math.random(#Positions)] though I don't know if this will work I didn't look over the full script
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
26 Nov 2013 09:58 PM
Like this?


local Positions = {"0.25","0.50","0.75","0.1"}
player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect (function () -- gui connection
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = UDim2.new (0,1,0,1) -- UDim is how to make a new position/size, just like Vector3, except it's 2 cordinate graphs, also 0,0 is on the top right, not top left!
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = UDim2.new (math.random (0,1),math.random(0,1),math.random(0,1),math.random(0,1))
player.PlayerGui.ScreenGui.Frame.Textbutton.Position = UDim2.new (Position (math.random [#Positions]))
end)
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
27 Nov 2013 03:39 AM
I think the function is wrong, when I click, this does not do ANYTHING
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