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
 

I misunderstand BindableEvents

Previous Thread :: Next Thread 
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
02 Jan 2017 08:34 PM
function FetchData(player)
-- find player data, return data
end
events.DataRequest.OnInvoke:connect(FetchData)

21:31:11.971 - OnInvoke is a callback member of BindableFunction; you can only set the callback value, get is not available


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
02 Jan 2017 08:35 PM
What is a callback member/callback value?
What does it mean, "set" and "get"?


Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
02 Jan 2017 08:36 PM
Uh what Let me make some code because idk what your doing.
Report Abuse
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
02 Jan 2017 08:37 PM
if it's a callback

then you should be doing events.DataRequest.OnInvoke = func

i think??? i don't remember them working this way either
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
02 Jan 2017 08:39 PM
Sorry, I'm mixing my understanding with Events, must be.


Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
02 Jan 2017 08:43 PM
[A remote function named "GetProduce" in workspace]
[A remote event named "GrowApples" in workspace]


[script 1]
local potatos = 23
local apples = 10

workspace.GrowApples.Event:connect(function(num)
apples = apples + num
end)

function workspace.GetProduce.OnInvoke()
return potatos,apples
end


[script 2]
local function printproduce(p,a)
print("Heres todays crop",p,a)
end
local potatos,apples = workspace.GetProduce:Invoke()
printproduce(potatos,apples)
workspace.GrowApples:Fire(10)
local potatos,apples = workspace.GetProduce:Invoke()
printproduce(potatos,apples)




Heres todays crop 23 10
Heres todays crop 23 20
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
02 Jan 2017 08:46 PM
Gotchya, very helpful, thanks.


Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
02 Jan 2017 08:50 PM
your notation is wrong, i think

it should be

bindfunc.OnInvoke(args)
print(args)
end

bindfunc:Invoke("LOL")


Formerly xXTheRobotXx, add 13,349 posts
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