InvokeServer can only be called from the client

So i have client script with such line:
local upgradeDetails, errorMessage = upgradeEvent:InvokeServer(unit.Id)
and getting such error:
18:42:39.904 InvokeServer can only be called from the client - Client - UpgradeZone:285
the script is located in StarterPlayerScripts
any ideas?

To run on the client the script will need to be a LocalScript or a Script with it’s RunContext set to Client.

my script is LocalScript located in StarterPlayerScripts. even error color is blue
image

Is the script RunContext Property set to Client?

there’s no ‘RunContext’ property on LocalScripts

Then try copying the script and paste it in a server script and change RunContext to Client

Yeah, now i have ‘RunContext’ property, and set it to ‘Client’
but still getting the same error

Where is your remotefunction at?

game.ReplicatedStorage.Events.Forge

Could you try changing the location of the script (after reverting back to a local script) and change it to something like StarterGui.

moved to StarterGui, still the same error. I guess that’s studio bug

Restart your studio and if you still meet this issue, then contact roblox probably.