Gamepass script is not working/FireServer from the Server?
I made a gamepass which a user can buy when he/she clicks on an imagebutton, here is the code in a local script in the imagebutton.
3 | script.Parent.MouseButton 1 Click:Connect( function () |
4 | game:GetService( "MarketplaceService" ):PromptGamePassPurchase(game.Players.LocalPlayer,id) |
and here is the code in a script in ServerScriptService
2 | game:GetService( "MarketplaceService" ).PromptGamePassPurchaseFinished:Connect( function (plr,ido,purchased) |
3 | if purchased and id = = ido then |
5 | game.ReplicatedStorage.GiveLongSword:FireServer() |
I think the script isn't sensing when the player buys the gamepass because when I click on the imagebutton the "print("Paid")" isn't in the output. Also since the server would be trying to fire another server, do I have change it so it fires a client instead?