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: Event happening without it actually happening

Previous Thread :: Next Thread 
Jeysea is not online. 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
jumpykilldestroy is not online. jumpykilldestroy
Joined: 15 Jul 2012
Total Posts: 12319
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 is not online. Jeysea
Joined: 13 Apr 2015
Total Posts: 268
12 Nov 2015 10:43 AM
Thanks a bunch man!
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