#need help on gamepass button
1 messages · Page 1 of 1 (latest)
Can you send a ss of the output and the code
sure
Alr so for 1 try doing activated so mobile players csn use it too
its activated
Instesd of mouseclikded*
I think it's doesn't do anything because when a product is purchased, nothing is handling it
** You are now Level 1! **
so what does that mean
but then it calls ss
local Players = game:GetService("Players")
local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassID = 1334077780
local ToolName = "SpeedCoil"
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamepassID) then
script[ToolName]:Clone().Parent = player.Backpack
end
end)
end)
like my script is to give the player that buyed the gamepass a speed coil
so what prompt should i pick
the gamepass one, since you're using PromptGamePassPurchase
yep
PromptGamePassPurchaseFinished
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, isPurchased)
if isPurchased then
if gamePassId == speedCoilId then
local coil = CoilModel:Clone()
coil.Parent = player.Backpack
end
end
end)
do it like this
replace the variables
where should i paste that
** You are now Level 3! **
it should be serverscriptservice
ok lemme try
anything that you handle in client, will stay on client only
localscript is for clients only
screenshot your script code in the ssservice
oh that's why
i gtg
alright
local MarketplaceService = game:GetService("MarketplaceService")
local CoilModel = (where is the coil?)
local speedCoilId = (gamepass id of coil)
put this at the very top
yeah store the coil there
oh
so when you call something in the serverstorage, you need like game.ServerStorage
game.serverstorage.SpeedCoil maybe?
for best practice instead of game.ServerStorage use game:GetService("ServerStorage")
ok
that's right
oh ok i understande it now
is this ok?
`local MarketplaceService = game:GetService("MarketplaceService")
local CoilModel = (game.ServerStorage.SpeedCoil)
local speedCoilId = (1334077780)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, isPurchased)
if isPurchased then
if gamePassId == speedCoilId then
local coil = CoilModel:Cone()
coil.Parent = player.Backpack
end
end
end)`
yeah good
** You are now Level 2! **
thanks
does it work now?
show the script now
sss?
are you sure that is a gamepass?
sure
it should be :Clone()
spelled wrong
CoilModel:Cone() to CoilModel:Clone()
oh bro did clone( )
make sure your output bar is on, so you know if there's an error
that will also give you clue on what to fix
np
tbh I don't have an idea on building so idk how to fix that