So I tried making a check for my shop so that I don't scam the players. So that if the event isn't running then they won't buy it. And It doesn't work. Here's the code. ServerScript:
local function checkEvent()
if not EventRunning then
return true
else
return false
end
end
game.ReplicatedStorage.CheckEvent.OnServerInvoke = checkEvent()
LocalScript:
Frame.ShpBuy2.MouseButton1Click:Connect(function()
local ChckEvnt = EventCheck:InvokeServer()
print(ChckEvnt)
if ChckEvnt then
MarketService:PromptProductPurchase(plr, 1009546097)
else
print("No event is running!")
end
end)

2 comments
Tell me which script is the error occurring in, you can check this by clicking on the error when you get it. But it may be like that because of the return false and return true since both of them are boolean values, otherwise right now, I might 100% sure.
Both scripts get the same error.