|
| 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 |
|
|
| |
|
| |
|
DavidBene
|
  |
| Joined: 26 Nov 2014 |
| Total Posts: 163 |
|
|
| 01 Feb 2015 07:23 PM |
| You have "function" spelled wrong. |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 Feb 2015 07:28 PM |
| Hm Even with that still not working. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 01 Feb 2015 07:38 PM |
| So how would I get the players? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 01 Feb 2015 09:26 PM |
| I got it figured out Thanks! |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2015 04:00 PM |
Do when you want it to be checked. You put a 'd'?
As in moved? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 02 Feb 2015 04:25 PM |
Instead of move() what about it its check()
would it be checkd? |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|