#Troll Button Not Working
1 messages · Page 1 of 1 (latest)

When a player presses this button and buys the developer product, an image is supossed to appear on the screen like a jumpscare + a sound, im gonna show the scripts and everything i did below, i got my script off chat gpt
.
Script inside ServerScriptService :
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("TrollEvent")
local PRODUCT_ID = 3562278603
MarketplaceService.ProcessReceipt = function(receiptInfo)
local buyer = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not buyer then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == PRODUCT_ID then
print(buyer.Name .. " bought Troll All!")
for _, player in pairs(Players:GetPlayers()) do
if player ~= buyer then
event:FireClient(player)
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
LocalScript Inside Screen GUI :
local event = game.ReplicatedStorage:WaitForChild("TrollEvent")
local image = script.Parent:WaitForChild("ImageLabel")
local sound = image:WaitForChild("Sound")
event.OnClientEvent:Connect(function()
print("Troll triggered!") -- debug
image.Visible = true
sound:Play()
task.wait(3)
image.Visible = false
end)
LocalScript Inside The TextButton :
local button = script.Parent
local player = game.Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
local PRODUCT_ID = 3562278603
button.MouseButton1Click:Connect(function()
MarketplaceService:PromptProductPurchase(player, PRODUCT_ID)
end)
Images to help you understand where everything is :
was hard to notice but you are missing an underscore in the receiptInfo.ProductId == PRODUCTID so it should be receiptInfo.ProductId == PRODUCT_ID
so the issue is more like its checking if ProductId is = to nil not the product id you set
hope it works! 
oh i fear thats just discord making it cursive
it was receiptInfo.ProductId == PRODUCT_ID in the script already sadly.....
weird
hmm yea
let me try real quick in my studio and ill send you the fix
tyy
** You are now Level 1! **
@rich ledge
can u check that for me?
how?
which one, test?
ye
does it happen after u buy the pass?
no
oh wait, do you want the jumpscare for everyone?
yea EXCEPT the one who buys it
even the player that bought it
no
hmmm
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("TrollEvent")
local PRODUCT_ID = 3562278603
MarketplaceService.ProcessReceipt = function(receiptInfo)
local buyer = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not buyer then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == PRODUCT_ID then
print(buyer.Name .. " bought Troll All!")
for _, player in pairs(Players:GetPlayers()) do
if player.UserId ~= buyer.UserId then
event:FireClient(player)
else
print("buyer")
end
end
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end```
try this
buy the pass in studio
and tell me what the output says
inside servicescriptserveice?
yep
still.....
what does trhe output say?
is ur image's visible = true or false?
F9?
did u buy it?
hm
yup same thing
thats weird that it doesnt even say buyer
want me to give u perms to edit my game???
no i cant i gotta go sleep already, might be studio access
** You are now Level 2! **
2nd one
i tested ur place
it works but not exactly how i want it to work, i want my image to pop up and then dissapear
he is not ai 😭
I jus made that image as test vro
Try putting the script that shows it in starterplayerscripts
i check ur game
u have a script under image label which i wasnt aware about, thats why urs worked