I m trying to setText as players name(i have them in array) on 12 independent Loud_buttons using index
For Example:
PlayerName[0] for button1 but it says
[This invocation calls a function that has the ‘decides’ effect, which is not allowed by its context. The ‘decides’ effect indicates that the invocation calls a function that might fail, and so must occur in a failure context that will handle the failure. Some examples of failure contexts are the condition clause of an ‘if’, the left operand of ‘or’, or the clause of the ‘logic’ macro.(3512)]
What I have tried so far is as follows :
1:Used on OpenUI Function // it had following properties called in it
FetchTeamPlayers()
UI.AddUI[PlayerAgent]
GetPlayerName()
UI.GetHUI()
But Than
T_Button.InteractedWithEvent.Subscribe(OpenUI)
started having issues that it cant take decide function
2:Made Separate fucntion TO setText With Decide Effect to abstract it directly from .Subscribe thing
(obviously than called it in OpenUI)
like
OpenUI(PlayerAgent: agent): void =
{
FetchTeamPlayers()
UI.AddUI[PlayerAgent]
GetPlayerName()
UI.GetHUI()
SetBText[]
}
still it wants me to add decide effect on it so now i m stuck with an error on T_Button.InteractedWithEvent.Subscribe(OpenUI) that says
This function parameter expects a value of type agent->void, but this argument is an incompatible value of type type{_(:agent):void}.(3509)
Any Help Or Solution will be highly appreciated