#donation board not working

163 messages · Page 1 of 1 (latest)

torpid furnace
#

I made a donation board and tried to script it. I tried 2 different tutorials and none of them worked. I already have my developer products made. Can someone help me?

crisp umbra
torpid furnace
#
local ID = 1566853572
local mps = game:GetService("MarketplaceService")

script.Parent.MouseButton1Click:Connect(function()
    mps:PromptProductPurchase(game.Players.LocalPlayer,ID)
end)
crisp umbra
#

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

torpid furnace
#

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

crisp umbra
#

weird

#

is it a localscript

#

& also print smth to console before and after the promptproductpurchase to see if the script runs

torpid furnace
crisp umbra
#

what tab in explorer is it in

#

like workspace, startergui

torpid furnace
#

It's in a part

#

Weird it's not even printing

crisp umbra
#

thats why

#

localscripts dont work in workspace

torpid furnace
#

Wait they dont?

crisp umbra
#

sadly

torpid furnace
#

But how will i-

#

I think I got an idea

crisp umbra
#

hm

torpid furnace
#

Would a module script work

crisp umbra
#

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

torpid furnace
crisp umbra
#

not sure

#

i never used mps so im gonna watch a quick vid and try and help you out

torpid furnace
#

Ok

crisp umbra
#

id assume it wouldnt since PromptProductService(••, ••)

#

the first •• is the player you prompt it to

torpid furnace
#

So if I used a script?

crisp umbra
#

you could try it that way but im not sure if its the best

#

if you tried that use the code

torpid furnace
#

I just started the game to see if a normal script would work

#

Nvm

crisp umbra
#
local ID = 1566853572
local mps = game:GetService("MarketplaceService")

script.Parent.MouseButton1Click:Connect(function(hit)
    mps:PromptProductPurchase(hit,ID)
end)
torpid furnace
#

It says it should be a type of player

crisp umbra
#

paste in the code i sent try that

#

if that doesnt work then

torpid furnace
crisp umbra
#

yeah

torpid furnace
#

Ok

crisp umbra
#

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

torpid furnace
#

i wanna do donation board bc it would be faster also i dont feel like designing a gui

crisp umbra
#

ima look into the code of one and see if theres something youre missing

torpid furnace
#

Just pasted it and bout to test

crisp umbra
#

alright

torpid furnace
#

It still says player should be a type of player

crisp umbra
#

okay i checked some good donation boards

torpid furnace
#

So now we know that the function works now

crisp umbra
#

alright

#

in the part

#

do you have a clickdetector?

torpid furnace
#

Nope

crisp umbra
#

insert a clickdetector into the part

#

then put the script inside the clickdetector

torpid furnace
#

Done

crisp umbra
#

now try it

torpid furnace
#

Whoops thought I stopped the game

crisp umbra
#

lol i do that a lot

torpid furnace
#

Still errors

#

Was I supposed to put the click detector in a button orr?

crisp umbra
#

if you want the player to click the part then you should just have it in the part

#

what error does it give

torpid furnace
#

Sam's thing

torpid furnace
crisp umbra
#

let me see the board

torpid furnace
#

this is how i set it up

crisp umbra
#

is it a decal or are all the green parts individual parts

torpid furnace
#

indivisual

crisp umbra
#

okay so if you put the clickdetector & script in one of the robux buttons it should work

torpid furnace
#

ok

crisp umbra
torpid furnace
#

yes

crisp umbra
#

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

torpid furnace
#

ok im about to test my code again but with the click detector

crisp umbra
#

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)
torpid furnace
#

k

crisp umbra
#

works for me that way so it should for u

torpid furnace
#

um it has to be usable for the text button

crisp umbra
#

can i see the layout in workspace

torpid furnace
torpid furnace
crisp umbra
#

okay

#

ill make one for textbutton

#

and see

#

thats my bad i didnt know it was the button thing

torpid furnace
crisp umbra
#

okay you can delete the clickdetector

#

i see the problem

#

for some reason its inputting 'hit' as nil instead of the players username

torpid furnace
#

i will never fully understand how roblox works

crisp umbra
#

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

torpid furnace
#

ok

crisp umbra
#

well apparently those dont return anything

#

uhhhh

#

thats just lovely

torpid furnace
#

what

crisp umbra
#

for some reason roblox decided to not add a feature to return a player (hit) for textbutton.MouseButton1Click

torpid furnace
#

L roblox

young bisonBOT
#

studio** You are now Level 10! **studio

crisp umbra
#

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

torpid furnace
#

yooo lets gooo it worked

torpid furnace
#

ima make sure im completely good to go

crisp umbra
#

right before the promptproductpurchase

torpid furnace
#

ok

crisp umbra
#

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

torpid furnace
#

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

crisp umbra
#

damn

#

yeah its kinda difficult to get the localplayer from a serverscript there

torpid furnace
#

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)
torpid furnace
#

any other ideas?

crisp umbra
#

i got no idea tbh

#

the fact roblox doesnt return the player that clicks a TextButton screwed the whole plan up

torpid furnace
#

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

crisp umbra
#

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

torpid furnace