#donation board not working
163 messages · Page 1 of 1 (latest)
local ID = 1566853572
local mps = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function()
mps:PromptProductPurchase(game.Players.LocalPlayer,ID)
end)
that codes the popup for the donation
doesnt add it to the board
do u mean it doesnt add players to it or it doesnt popup the purchase
The popup purchase doesn't show
It's supposed to bring up a purchase menu like what you would see when buying any items on roblox but for some reason it ain't working
weird
is it a localscript
& also print smth to console before and after the promptproductpurchase to see if the script runs
It's a local script
Wait they dont?
sadly
hm
Would a module script work
if you work it with gui you can put localscripts in there in startergui
modulescripts are more of a storage
you can use regular scripts and just find the localplayer w a bit of code but
if an exploiter joins he can mess someones purchase & theres prib a few other problems
Won't that make it so everyone in the server will see the prompt
Ok
id assume it wouldnt since PromptProductService(••, ••)
the first •• is the player you prompt it to
So if I used a script?
you could try it that way but im not sure if its the best
if you tried that use the code
local ID = 1566853572
local mps = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function(hit)
mps:PromptProductPurchase(hit,ID)
end)
It says it should be a type of player
Normal script right?
yeah
Ok
id recommend making a gui donation thing, checking the code off of a good free model donation board and learning off of that, or wait for a more experienced scripter to come here
if it doesnt work^^
since ive never used that service
i wanna do donation board bc it would be faster also i dont feel like designing a gui
ima look into the code of one and see if theres something youre missing
Just pasted it and bout to test
alright
It still says player should be a type of player
okay i checked some good donation boards
So now we know that the function works now
Nope
Done
now try it
Whoops thought I stopped the game
lol i do that a lot
if you want the player to click the part then you should just have it in the part
what error does it give
Sam's thing
I want them to be able to click the text button
this?
let me see the board
is it a decal or are all the green parts individual parts
indivisual
okay so if you put the clickdetector & script in one of the robux buttons it should work
ok
was this the error you were getting again
yes
weird
cause ima compare ur script to a free model
local ID = 1566853572
local mps = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function(hit)
mps:PromptProductPurchase(hit,ID)
end)
local CLICK_BLOCK = script.Parent
local ITEM_ID = 1338428775 --Change to your product ID--
local Click = Instance.new("ClickDetector",CLICK_BLOCK)
Click.MouseClick:connect(function(p)
game:GetService("MarketplaceService"):PromptProductPurchase(p,ITEM_ID)
end)
they both are the same exact thing
weird how urs doesnt work
ima recreate my own w ur code ill check
ok im about to test my code again but with the click detector
oh
idk why but MouseButton1Click isnt an option for those
use this code and this setup in workspace
local ID = 1566853572
local mps = game:GetService("MarketplaceService")
script.Parent.MouseClick:Connect(function(hit)
mps:PromptProductPurchase(hit,ID)
end)
k
works for me that way so it should for u
can i see the layout in workspace
might work for the part but i need it to work with the text button
ok
okay
ill make one for textbutton
and see
thats my bad i didnt know it was the button thing
okay you can delete the clickdetector
i see the problem
for some reason its inputting 'hit' as nil instead of the players username
i will never fully understand how roblox works
my motivation for its just like minecraft
i get a huge burst and then just
lose it all
ima eat rq and see if theres a fix
ok
what
for some reason roblox decided to not add a feature to return a player (hit) for textbutton.MouseButton1Click
L roblox
** You are now Level 10! **
delete clickdetector so script is under the button
this code should work for it
local player = game.Players.PlayerAdded:Wait()
local ID = 1566853572
local mps = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function()
mps:PromptProductPurchase(player,ID)
end)
so line 1 gets the username of your player
but idk if it changes if someone else joins
you should probably try a teamtest w someone and put print(player) inside the function
just to be safe
yooo lets gooo it worked
ok so where do i put the print
ima make sure im completely good to go
right before the promptproductpurchase
ok
no doubt it should work singleplayer
i just dk if itd change the player variable each time someone joins
so safe to team test in studio
Lemme see if I can find someone
Having a hard to finding someone
Ok so there's a bit of a problem
I didn't have anyone to test it with so I used an alt
I clicked the button with my main and it worked
But when I clicked on my alt it showed the prompt for my main
So I don't rlly think it changes
@crisp umbra it only shows for one player when anyone clicks it
So idk what's up with that
dont rlly know what to do here
we would somehow need to update the player when the button is clicked
im tryna figure out how to update the player rn to who ever clicks the button
ik this aint right but im tryin my best🥲
local player = game.Players.PlayerAdded:Wait()
local ID = 1566853572
local mps = game:GetService("MarketplaceService")
script.Parent.MouseButton1Click:Connect(function()
player = game:GetService("Players")
wait(0.1)
mps:PromptProductPurchase(player,ID)
end)
any other ideas?
i got no idea tbh
the fact roblox doesnt return the player that clicks a TextButton screwed the whole plan up
my friend fixed it
ig it can only be done using a part
i thought it could be done with just script but i dont think roblox allows it
yeah
if i find a way to do it ima lyk
cause i saw a free model that used the textbuttons but in the script they included a bunch of stuff to find top donators and even get their avatars and stuff
so i couldnt find the part thats solely for sending the product purchase
cool