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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Event Triggers.

Previous Thread :: Next Thread 
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 06:40 PM
I want to be able to easily refer to triggered events in one script. Currently if I want to change a property of an object I have to create a function telling the property to change and create an event connector like this;

script.Parent.X.Y:connect(Z)

But I want to be able to use it like this.


if script.Parent.X.Y=true then etc...

if there is a way I could do this or something similar then it would be much appreciated.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Sep 2013 06:40 PM
script.Parent.Blah.Changed?
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
10 Sep 2013 06:42 PM
object.Changed:connect(function(p)
-- Ask if p is the correct property
end)
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 06:44 PM
What I'm asking is if I could directly affect properties with an event.
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
10 Sep 2013 06:44 PM
What..?
Report Abuse
WillScriptForFood is not online. WillScriptForFood
Joined: 03 Aug 2013
Total Posts: 701
10 Sep 2013 06:44 PM
You could use an anonymous function:

x.y:connect(fuction(z)
-- stuff;
end);


or, you can use a loop:

while true do
x.y:wait();
-- stuff;
end;
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 06:49 PM
Ooh. rather brilliant. Let me try it out. thanks!
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:06 PM
This is promising but it would be ideal if I was able to do an if x.y=true then etc... ordeal. I could manage without it but it would be helpful.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Sep 2013 07:06 PM
What the heck is x.y = true?
Is x an object and y a boolean value and don't you mean "==" ??
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
10 Sep 2013 07:08 PM
no idea if this would work but
object.Event:connect(object.Transparency=1)
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:08 PM
x=object, y=trigger and sorry, I did mean ==
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
10 Sep 2013 07:11 PM
Events are userdata, not functions. They are C-sided classes; you can't write a function that does the same thing as an event.
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:11 PM
y=Event I mean
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:13 PM
Then is there a way I can use those events to directly affect the properties of an object?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Sep 2013 07:13 PM
So you want to check if an event is true, or if it's just not false/nil?
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:16 PM
Both. for instance; the Event Jumping doesn't have a counter Event. therefore if I wanted a light to turn on when you are jumping that is simple enough. But turning it off again when you stop jumping is a different matter. I want to find out how I could do that.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Sep 2013 07:17 PM
Humanoid: does have a jumped event.
http://wiki.roblox.com/index.php/Jumping_(Event)
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:19 PM
I know but it doesn't have a counter event like MouseHoverEnter has MouseHoverLeave.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Sep 2013 07:20 PM
You can make your own.
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
10 Sep 2013 07:20 PM
Events don't have "counter events." An event is triggered when something happens. When it "stops happening" isn't relevant.
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:23 PM
I am not communicating this well apparently. I want something to change once an Event stops happening! Once I stop Jumping I want a light to turn off.
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:24 PM
So yes. It is very relevant.
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
10 Sep 2013 07:32 PM
If you click a clickdetector then an event is fired. There is no event for when you "stop clicking it," that doesn't make any sense. Humanoid.Idle should suffice for you.
Report Abuse
NastyDax is not online. NastyDax
Joined: 12 Sep 2011
Total Posts: 71
10 Sep 2013 07:39 PM
Not for what I'm planning. I am not completely void of intelligence and I would appreciate it if you would treat people as such.
Report Abuse
WillScriptForFood is not online. WillScriptForFood
Joined: 03 Aug 2013
Total Posts: 701
10 Sep 2013 07:47 PM
Humanoid.Jump.Changed:connect(function(value)
if (value) then
-- stuff;
else
-- stuff;
end;
end);
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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