Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

I Made a Script Where If you buy a Dev Product it Teleports you to a part why is it not working?

Asked by 3 years ago
local MPS = game:GetService("MarketplaceService")
MPS.ProcessReceipt = function(receiptInfo)
    if receiptInfo.ProductId == 1052512510 then
        local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)
        local player_name = player.DisplayName
        local ws_player = workspace:FindFirstChild(player_name)
        ws_player:SetPrimaryPartCFrame(script.Parent.Parent.Parent.Workspace.RankGiverPads.Model1.TouchPart.CFrame + Vector3.new(0,5,0))
        return Enum.ProductPurchaseDecision.PurchaseGranted
    end
end
0
there is a easier way to do this DuckyRobIox 280 — 3y
0
lemme answer DuckyRobIox 280 — 3y
0
ok how? SirOmeletGaming 9 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Ok suprised no-one answered this already, its pretty easy. The script goes like this:

local MPS = game:GetService("MarketplaceService")

MPS.ProcessReceipt = function(RInfo)
    local PlrId = RInfo.PlayerId
    local Plr = game.Players:GetPlayerByUserId(PlrId)
    local Char = Plr.Charatcer or Plr.CharacterAdded:Wait()
    local ProductId = RInfo.ProductId

    if ProductId == 1052512510 then
        Char.HumanoidRootPart.CFrame = CFrame.new(workspace.RankGiverPads.Mode11.TouchPart.Position + Vector3.new(0,5,0))
    end

    return Enum.ProductPurchaseDecision.PurchaseGranted
end

This should work though there ming be some spelling mistakes in it, so thats up to you to find and sort

0
Thanks! SirOmeletGaming 9 — 3y
Ad

Answer this question