As the title says, my rbxl file is working. But, the Roblox save file doesn’t.
Here’s my script.
-- ServerScript
local MarketplaceService = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local ProdID = 1235535323
local function processReceipt(receiptInfo)
local player = players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if player then
game:GetService("ReplicatedStorage"):WaitForChild("Revive"):FireClient(player)
print("yuh yuh yuh")
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt
--Local Script
local placeToTeleportTo = CFrame.new(game:GetService("Workspace"):WaitForChild("ReviveSpawn").Position)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local function Revive()
local Character = player.Character or player.CharacterAdded:Wait()
Character:PivotTo(placeToTeleportTo)
player.Character:FindFirstChild("HumanoidRootPart").Anchored = false
player.PlayerGui:FindFirstChild("Died"):Destroy()
game:GetService("Lighting").Blur.Enabled = false
player.PlayerGui:WaitForChild("Health").Enabled = true
end
game:GetService("ReplicatedStorage"):WaitForChild("Revive").OnClientEvent:Connect(Revive)
I’ve never seen anyone else having issues with this. I’m experiencing the same problem on other games, aswell.
Thanks for the response.
The revive button doesn’t work. As you can see I’m printing “yuh yuh yuh” on the server script; this does not print.
However, on the rbxl file everything is working perfectly.
I’m trying to make it work on the public game file.
Hello there. Could you possibly provide us with the output? Did you receive any errors? You said that it worked on the local game and not the Roblox one, but what do you mean by local. Do you mean the Studio Version that is saved locally on your PC, the Studio Version published to Roblox, or the actual Roblox game itself? Thank you.
I recommend you test it in Studio and debug the purchase function. Either use print statements or the debugger. Check to see what line the code stops executing in order to find the cause of the problem.
You know, it might have something to do with this local script:
local t = 15; --how long does it take to go through the rainbow
local tick = tick
local fromHSV = Color3.fromHSV
local RunService = game:GetService("RunService")
local Frame = script.Parent
local Button = Frame:WaitForChild("Button")
RunService:BindToRenderStep("Rainbow", 1000, function()
local hue = tick() % t / t
local color = fromHSV(hue, 1, 1)
Frame.BackgroundColor3 = color
end)
Button.MouseButton1Down:Connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, 1235535323)
end)
This is the purchase button script. cause it doesn’t even seem that the server script is getting activated.