drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 19 Jun 2013 12:25 PM |
"function onPlayerEntered(player) gui:TweenPosition(UDim2.new(0, 660, 0, 45), "Out", "Float", 0.5 , true) end"
whats my flaw? |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 19 Jun 2013 12:26 PM |
'gui' is not defined 'onPlayerEntered' is not connected to an event |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
| |
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 19 Jun 2013 12:30 PM |
would it be gui = script.parent ? and how do I connect onPlayerEntered to a event? |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2013 12:30 PM |
To fix the onPlayerEntered add the line 'game.Players.ChildAdded:connect(onPlayerEntered)' To fix the 'gui' problem, just replace 'gui' with the path to the object you want to Tween. For example, if you want a GUI's Frame to be Tweened, and the script is a direct child of it, then you would put in 'script.Parent' |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
| |
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 19 Jun 2013 12:38 PM |
"function onPlayerEntered(player) game.Players.ChildAdded:connect(onPlayerEntered) script.Parent:TweenPosition(UDim2.new(0, 660, 0, 45), "Out", "Float", 0.5 , true) end" doesn't work... |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2013 12:40 PM |
No, no, no...
The connection line goes outside the function.
Like this:
function onPlayerEntered(player) script.Parent:TweenPosition(UDim2.new(0, 660, 0, 45), "Out", "Float", 0.5 , true) end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 19 Jun 2013 12:40 PM |
| You put the connection line after the function. Also, this again wont' work as 'script.Parent' likely isn't a GUI object, and if it is I do not understand why you're even using the 'PlayerAdded'/'ChildAdded' events... |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 19 Jun 2013 12:41 PM |
| the parent is a text box, and I want it to happen when the play enters. |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2013 12:45 PM |
@Desperian
He is most likely using it for a 'Player PLAYERNAME has entered the game!' type GUI.
Never ask why someone is doing something, just help them fix their problems, because this is Scripting Helpers, not Game Design. |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
|
| 19 Jun 2013 12:48 PM |
"function onPlayerEntered(player) script.Parent:TweenPosition(UDim2.new(0, 660, 0, 45), "Out", "Float", 0.5 , true) end
game.Players.ChildAdded:connect(onPlayerEntered)"
Still wont work. does it work with text boxes, and image labels? if it doesn't thats my problem. |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 20 Jun 2013 03:18 AM |
@Fire, Asking why they're doing something is quite beneficial for helping them. While you're stating it's likely a 'Player NAME has entered the game' he's not changing the text anywhere, and he's just moving it to one position, which makes it seem more like a rule screen. And if it was, he wouldn't need a connection line, nor that function. So please, do not try to lecture me.
---
@OP, There's no such 'EasingStyle' as 'Float'.
http://wiki.roblox.com/index.php/EasingStyle_(Enum) |
|
|
| Report Abuse |
|
|
drahsid5
|
  |
| Joined: 13 May 2011 |
| Total Posts: 3937 |
|
| |
|