ResetButtonCallback must be set to a BindableEvent or a boolean

I want to get when the player clicks his Reset button and Connect it to a function.
I have tried using

game:GetService("StarterGui"):SetCore("ResetButtonCallback",Event)

but when i use it in a Server script the game prints an error saying

 StarterGui:SetCore must be called from a local script.

and when i use it in a Local Script and try to Connect it to a Bindable Event it says

ResetButtonCallback must be set to a BindableEvent or a boolean

What can i use to link the ResetButtonCallback to a Server Side function.
Any help would be greatly appreciated

Can you send your whole script?

function RemoveCash()
– Here Should The Function Start
end

game:GetService(“StarterGui”):SetCore(“ResetButtonCallback”,RemoveCash())

i have also tried to connect it to a Bindable Event

local Event = game.ReplicatedStorage.Event
game:GetService(“StarterGui”):SetCore(“ResetButtonCallback”,Event)

You can only set ResetButtonCallback to a bool or BindableEvent. You can not set ResetButtonCallback as a function.

Is Event a RemoteEvent or BindableEvent?

its a BindableEvent, i can’t fire it from a local script and i can’t access game:GetService(“StarterGui”):SetCore(“ResetButtonCallback”,Event) from a server side script because the SetCore function can only be fired from a local script, So how can i link the SetCore function to Bindable Event?

i have solved the problem, i think the issue was that i have placed the bindable event in Replicated Storage so it couldn’t be detected but thanks for the help provided.