#Gamepasses not working
1 messages · Page 1 of 1 (latest)
It should be the ID that’s the only thing I see
the ID's are right trust me i checked like 50 times
Could you show the two codes
one sec
they are in one script
the speedcoil one works but the gravity one doesnt
i get them when im testing in studio since i own them, but the gravity coil doesnt show the pop up when trying in another account
I don’t really remind how gp prompts works but I think you do not need a remote
Like just put them a LocalScript directly in the button
this is the main script in serverscript
** You are now Level 1! **
This is the prompt that doesn’t display right?
no it should work since i have the exact same code in the speedcoilbutton
and it does work
since i get it when im testing in studio
the main problem here is that when live testing with a accoutn that doent own the gamepass, the pop up to buy it doesnt show for the gravitycoil
I would put the code to display the prompt directly inside of the localscript in the button, and if the users buy it, fire the remote event
And you handle the items giving within the server script with the remote event
the local script is in the button if thats what u mean
Like right here you only remote the server when the user click the button right?
yeah
local RemoteEvent = ReplicatedStorage:WaitForChild("RequestCoil")
yeah this line
MarketplaceService:PromptGamePassPurchase(player, info.ID)
This the thing to buy the gamepass, put it in localscript
No inside of the MouseButton1Click
And you put the remote event below
function(player) and local MarketplaceService = game:GetService("MarketplaceService")
i made this directly in the button
** You are now Level 2! **
and this in serverscript
same problem as before
speedcoil is working while gravity isnt
Brother your not even processing the recipt
wym
In server script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
local event = ReplicatedStorage:WaitForChild("RequestCoil")
local gamePasses = {
GravityCoilButton = {
ID = 1203607668,
ToolName = "GravityCoil",
},
SpeedCoilButton = {
ID = 1201245284,
ToolName = "SpeedCoil",
}
}
event.OnServerEvent:Connect(function(player, buttonName)
local info = gamePasses[buttonName]
if not info then
warn("Invalid button name sent:", buttonName)
return
end
print("Button Clicked:", buttonName, "by", player.Name)
local success, result = pcall(function()
return MarketplaceService:UserOwnsGamePassAsync(player.UserId, info.ID)
end)
print("Ownership check - Success:", success, "Result:", result)
if not success then
warn("Failed to check GamePass ownership:", result)
return
end
local ownsPass = result
if ownsPass then
local tool = ReplicatedStorage:FindFirstChild(info.ToolName)
if tool then
local clone = tool:Clone()
clone.Parent = player:FindFirstChild("Backpack")
print("Gave", info.ToolName, "to", player.Name)
else
warn("Tool not found in ReplicatedStorage:", info.ToolName)
end
else
MarketplaceService:PromptGamePassPurchase(player, info.ID)
end
end)
This LocalScript in each button and modify the FireServer line to put the other tool between strings
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("RequestCoil")
script.Parent.MouseButton1Click:Connect(function()
event:FireServer("GravityCoilButton")
end)
Make sure both of your tools are in ReplicatedStorage and with the same exact name and as Tool, not model or part
@hollow fulcrum
okay thank you
do you know why its returning that i dont own the gravutycoil's gamepass in studio