You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Make my rank management center work properly
What is the issue? Include screenshots / videos if possible!
20:21:56.987 - Unable to cast value to Object
20:21:56.989 - Stack Begin
20:21:56.989 - Script 'Players.49dec.PlayerGui.RankManagement.Main.ScrollingFrame.Example Rank.TextButton.LocalScript', Line 7
20:21:56.989 - Stack End
Script:
script.Parent.MouseButton1Click:Connect(function()
local plr = game.Players.LocalPlayer
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId, 5694417) then
local rankid = 4 --This is the rank that the user will be promoted/demoted to.
game.ReplicatedStorage.RankPlayer:FireServer(game.Players.LocalPlayer, rankid)
else
game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer.UserId, 5694417)
end
end)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I went on discord, and a experienced scripter told me to fix so it’s userid, gpid instead of gpid,userid.