Jeysea
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 268 |
|
|
| 12 Nov 2015 08:41 AM |
I have these functions:
function LoadStage(Stage) if Stage == 'One' then local Level = ScreenGui:FindFirstChild('Stage' .. Stage) if Level then Level.Position = UDim2.new(0, 0, 1, 0) Level:TweenPosition(UDim2.new(0, 0, 0, 0), 'In', 'Quad', .75, true) StageScreen:TweenPosition(UDim2.new(0, 0, -1, 0), 'Out', 'Quad', .75, true) end end end
function StageClicked(Stage) LoadStage(Stage) end
And then I have this event listener:
StageOne.MouseButton1Click:connect(StageClicked('One'))
For some reason, StageOne isn't even getting clicked but the event fires immediately. Any reason as to why? |
|
|
| Report Abuse |
|
|
| 12 Nov 2015 08:54 AM |
yes because your triggering it in the event
replace the clicked event with this:
StageOne.MouseButton1Click:connect(function()StageClicked('One')end)
a clicked event would normally need to be like this:
StageOne.MouseButton1Click:connect(StageClicked)
as you can see theres no () in the above event^ |
|
|
| Report Abuse |
|
Jeysea
|
  |
| Joined: 13 Apr 2015 |
| Total Posts: 268 |
|
| |