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 » Roblox » Suggestions & Ideas
Home Search
 

Re: ["FunctionValue"] A new edition to our Values.

Previous Thread :: Next Thread 
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
01 Feb 2015 07:13 AM
The only current way to make "custom properties" (Well kinda) is to add values such as NumberValue, StringValue, etc. (See http://wiki.roblox.com/index.php?title=Class_reference (scroll down to Values))

What if we had a FunctionValue?

Yes, a FunctionValue stores exactly what you think it does, a Function (See http://wiki.roblox.com/index.php?title=Functions)! This can be used for creating methods.

Like ObjectValues (No documentation on wiki for ObjectValue), a FunctionValue can only be set through commandbar/a script. Here's an example of how it works:


function func(self, ...)
print(...)
end

local FuncValue = Instance.new("FunctionValue", workspace.Part)

FuncValue.Value = func

FuncValue:Value("Hello")

--> Hello


So what exactly was self? Well without giving you a scripting lesson on methods, it's basically the table the function is in (For more information see http://wiki.roblox.com/index.php?title=Methods). It would be the FunctionValue instance itself. So assuming you wanted to change the parent's transparencey, here's another example:


function func(self)
self.Parent.Transparency = 1
end

local FuncValue = Instance.new("FunctionValue", workspace.Part)

FuncValue.Value = func
FuncValue.Name = "Invisible"

FuncValue:Value()

--Or from any other script:

workspace.Part.Invisible:Value()

Granted having to go :Value() instead of :Invisible() is a little annoying, but then again, so is the .Value property of any of these Values.

With all the other *Value objects, it only makes sense to have this. Without giving us custom instances, this may be the only real way to do this any time in the near future. (http://www.roblox.com/Forum/ShowPost.aspx?PostID=155068805)


Thank you for your time reading this, let's show some support!

Support Ratio; 1:0
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
01 Feb 2015 07:16 AM
Support

Also add UDim2 values, because having Ray values but not UDim2 values seems really stupid
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
01 Feb 2015 07:18 AM
Definite Support! :D
it's like ur taking all the ideas out of my head XD
cos all of the Suggestions u Posted (all that I seen) are the ones I've been thinking on sometimes
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
01 Feb 2015 07:18 AM
Support, even though they can be ran through _G, or through Remote/BindableEvents.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
01 Feb 2015 07:40 AM
Support Ratio; 4:0
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
01 Feb 2015 08:34 AM
No support; BindableFunctions, BindableEvents, ModuleScripts
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
01 Feb 2015 08:35 AM
That's kinda cool
Support!

Only I don't see why you can't just use a BindableFunction
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
01 Feb 2015 08:38 AM
Support Ratio; 5:1

The reason why not the use ModuleScripts, BindableEvents, etc. is simple.

newbies would have an easier time with FunctionValue.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
01 Feb 2015 10:43 AM
Bump.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
02 Feb 2015 06:28 AM
Bump.
Report Abuse
SamDomino is not online. SamDomino
Joined: 12 Jul 2012
Total Posts: 41
02 Feb 2015 04:11 PM

Support I guess.

Effort and Courage is useless without Purpose and Direction
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
02 Feb 2015 04:16 PM
Support Ratio; 6:1
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Feb 2015 01:18 PM
Bump.




Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
05 Feb 2015 01:25 PM
Hey, this could actually work. I could probably make custom open and close functions just by calling the function value. Nice suggestion.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Feb 2015 01:29 PM
Support Ratio; 7:1
Report Abuse
cocokiller5 is not online. cocokiller5
Joined: 12 Nov 2008
Total Posts: 12
05 Feb 2015 01:51 PM
Support. Even though this is far too complicated for me to comprehend. xD
Report Abuse
ForumTurret is not online. ForumTurret
Joined: 06 Jan 2015
Total Posts: 2817
05 Feb 2015 01:54 PM
How may this differ from any else value kind?
Report Abuse
ArcticSorcery is not online. ArcticSorcery
Joined: 19 Aug 2009
Total Posts: 4761
05 Feb 2015 01:56 PM
this thread is censored in the re:

gg, whitelist fail

anyways, it would be nice being able to share functions among scripts
Report Abuse
ForumTurret is not online. ForumTurret
Joined: 06 Jan 2015
Total Posts: 2817
05 Feb 2015 01:59 PM
I mean how could it be useful.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
05 Feb 2015 03:48 PM
Support Ratio; 9:1

Forum, How I love explaining my ideas to you :D

Basically, the same way a NumberValue is important. Except a FunctionValue could allow making methods for objects (well, sorta)

If you think a NumberValue or StringValue (etc.) is important, I see no reason why you wouldn't support this.
Report Abuse
ForumTurret is not online. ForumTurret
Joined: 06 Jan 2015
Total Posts: 2817
05 Feb 2015 04:07 PM
I must look more into the method thing, until I decide.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » Suggestions & Ideas
   
 
   
  • 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