of     1   

complexo
#223972788Sunday, August 20, 2017 11:27 AM GMT

I put a script in StarterCharacterScripts that instantly invokes a BindableFunction to get that player's loadout. However, the OnInvoke event never triggers, and the invoking script indefinitely waits for a response. What have I done wrong? This is the function I am trying to invoke: function script.getAttribute.OnInvoke(player, attribute) return players[player.UserId].attribute end
complexo
#223974332Sunday, August 20, 2017 12:29 PM GMT

bunp
sonihi
#223974771Sunday, August 20, 2017 12:46 PM GMT

Are you trying to trigger this from local script while defining the function on a server script? Cause that doesn't work, you need to make it a RemoteFunction.
complexo
#223975361Sunday, August 20, 2017 1:07 PM GMT

It's an ordinary sccript.
sonihi
#223977002Sunday, August 20, 2017 2:07 PM GMT

Ahh I see, can you add some prints to check if the code actually runs? Also can you show us the :Invoke() call?
complexo
#223978125Sunday, August 20, 2017 2:42 PM GMT

As I said, it gets to the invoking, but it stops there and the OnInvoke function never runs. loadout = PlayerStats.getAttribute:Invoke(player, 'loadout')
sonihi
#223978655Sunday, August 20, 2017 2:55 PM GMT

Well normally this would work and I can't tell ya with the code you provided.
complexo
#224001009Sunday, August 20, 2017 10:42 PM GMT

Bump
complexo
#224001271Sunday, August 20, 2017 10:47 PM GMT

Oh, I just found out what was wrong. It turns out that although I can use modulescripts in ReplicatedStorage, I can't use regular scripts there.
newdumbman2
#224001414Sunday, August 20, 2017 10:49 PM GMT

you cant have .variable it has to be [variable]

    of     1