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 » Scripters
Home Search
 

Re: -[ Simple Gui Problem

Previous Thread :: Next Thread 
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
01 Feb 2015 06:55 PM
It says that Expected = at move()

What is my problem?


funtion move() -- Transition the GUI to move
game.StarterGui.Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 5, false, nil)
end

script.Parent.MouseEnter:connect(move)

funtion orig()-- moves to orginal location
game.StarterGui.Frame:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 5, false, nil)
end

script.Parent.MouseEnter:connect(orig)
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
01 Feb 2015 07:01 PM
Hm.
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
01 Feb 2015 07:21 PM
Help Please?
Report Abuse
DavidBene is not online. DavidBene
Joined: 26 Nov 2014
Total Posts: 163
01 Feb 2015 07:23 PM
You have "function" spelled wrong.
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
01 Feb 2015 07:24 PM
Oh! Wow thank you!
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
01 Feb 2015 07:28 PM
Hm Even with that still not working.
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
01 Feb 2015 07:29 PM
"game.StarterGui.Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 5, false, nil)"

no one will see that gui...
Report Abuse
DavidBene is not online. DavidBene
Joined: 26 Nov 2014
Total Posts: 163
01 Feb 2015 07:34 PM
funtion move() -- Transition the GUI to move
game.StarterGui.Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 5, false, nil)
end

Your Tweening the position of the frame in the StarterGui, which will only update when a player dies. You need to edit the frame in the Player's PlayerGui. Also I am assuming that you have a ScreenGui, so you need to link that as well.

For example:

game.Players.buildmodel.PlayerGui.ScreenGui.Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 5, false, nil)

Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
01 Feb 2015 07:38 PM
So how would I get the players?
Report Abuse
DavidBene is not online. DavidBene
Joined: 26 Nov 2014
Total Posts: 163
01 Feb 2015 07:40 PM
If your using a localscript, you can use game.Players.LocalPlayer to get the player:


local player = game.Players.LocalPlayer

player.PlayerGui.ScreenGui.Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 5, false, nil)
Report Abuse
vacharya is not online. vacharya
Joined: 06 Jan 2011
Total Posts: 511
01 Feb 2015 07:42 PM
Anything in StarterGui will be replicated to each player under Players.vacharya.PlayerGui, so the player would see not the gui that is inside Starter Gui but the cloned one inside their player gui
put a local script inside the button, this will tween the button's position for the local player
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
01 Feb 2015 07:45 PM
So like this? * I just use brackets so it will be easier to identify the script. On forums.

[[
local player = game.Players.LocalPlayer


function move() -- Transition the GUI to move
player.PlayerGui.ScreenGui.Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 5, false, nil)
end

script.Parent.MouseEnter:connect(move)

function orig()-- moves to orginal location
player.PlayerGui.ScreenGui.Frame:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 5, false, nil)
end

script.Parent.MouseEnter:connect(orig)
]]
Report Abuse
vacharya is not online. vacharya
Joined: 06 Jan 2011
Total Posts: 511
01 Feb 2015 09:25 PM
--[[Explanation:
You will need a debounce to check if the gui has already been moved or not, in this case we will switch a bool variable to true if it is moved and switch it back to false if it's in its original position.
For more on debounce check this wiki link:
http://wiki.roblox.com/index.php?title=Debounce
]]
local player = game.Players.LocalPlayer
local moved = false

function move()
if not moved then
player.PlayerGui.ScreenGui.Frame:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 5, false, nil) -- Transition the GUI to move
moved = true
elseif moved then
player.PlayerGui.ScreenGui.Frame:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 5, false, nil)
moved = false
end
end

script.Parent.MouseEnter:connect(move)
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
01 Feb 2015 09:26 PM
I got it figured out Thanks!
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
02 Feb 2015 04:00 PM
Do when you want it to be checked.
You put a 'd'?

As in moved?
Report Abuse
vacharya is not online. vacharya
Joined: 06 Jan 2011
Total Posts: 511
02 Feb 2015 04:15 PM
Well when you just say
button.MouseOver:connect(move)
button.MouseOver:connect(back)
twice, the script doesnt know when to move it or when to move it backwards.
By adding a check "moved" it will move it back if the gui has already been moved then switch the moved to a false, or if it hasn't been moved then "moved" will be false and it moves to its position..
idk did that help?
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
02 Feb 2015 04:25 PM
Instead of move() what about it its check()

would it be checkd?
Report Abuse
vacharya is not online. vacharya
Joined: 06 Jan 2011
Total Posts: 511
02 Feb 2015 04:36 PM
when you say
:connect(move) --"move" is the function's name that will be ran when The event is fired in this case button.MouseEnter, You can use anything inside the brackets but you HAVE to define it as a function somewhere and it will be ran :D
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
02 Feb 2015 05:05 PM
Okay Thank you.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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