#developer product

1 messages · Page 1 of 1 (latest)

mossy mountain
#

help

#
--services
local MarketplaceService = game:GetService("MarketplaceService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")

--remote
local remote = ReplicatedStorage:WaitForChild("Troll")

--shortened functions to shorten the code
local function fling(player: Player)
end

local function explode(player: Player)
end

local function jumpscare(player: Player)
end

local handlers = {
    [3326769267] = fling,
    [3326769268] = explode,
    [3326769270] = jumpscare
}

local function handler(recieptInfo)
    local player = game.Players:GetPlayerByUserId(recieptInfo.PlayerId)
    if not player then 
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end
    
    player.CharacterAdded:Wait()
    
    local success, err = pcall(function()
        handlers[recieptInfo.ProductId](player)
    end)
    
    if success then
        return Enum.ProductPurchaseDecision.PurchaseGranted
    else
        warn(err)
        return Enum.ProductPurchaseDecision.NotProcessedYet
        
    end
end

MarketplaceService.ProcessReceipt = handler

ERROR: ReceiptId 6c0eb39786343833b79987ff9908c8b6 already being processed.
-> handler doesn't run
-> it errors if i buy any developer product more than 1 time

topaz valley
#

it has something to do with player.CharacterAdded:Wait() prob

mossy mountain
#

hmm

topaz valley
#

@mossy mountaini removed the player.CharacterAdded:Wait() and it worked

fiery sealBOT
#

studio** You are now Level 2! **studio

topaz valley
#

tbh its pointless waiting for a character thats already been added

#

unless the character resets then it will not yield

#

its basically waiting for the player to reset

mossy mountain
#

thank you

topaz valley
#

much simplier approach would be:

if not player.Character then
 player.CharacterAdded:Wait() -- much better
end
#

lemme know if it worked

mossy mountain
#

it did

#

but my other functions (besides explode) didn't

#

mind helping with those too?

topaz valley
#

wat da error?

mossy mountain
#

no, it doesn't work now

#

i mean it works called alone, not by the marketplace service

#
local function fling(player: Player)
    local character = player.Character or player.CharacterAdded:Wait()
    local HRP = character:WaitForChild("HumanoidRootPart")

    HRP.AssemblyLinearVelocity += HRP.CFrame.lookVector
    HRP.AssemblyAngularVelocity += Vector3.new(1, 1, 1) * 100
end```
#

the fling is janky

#

do you have any ideas on doing it in a better way

topaz valley
mossy mountain
#

it is flinging but it feels like a ripoff

#

when flinging mid-jump it just spins you too

topaz valley
#

hmm lemme try the fling

#

is this r15 or r6? game@mossy mountain

mossy mountain
#

i didn't change it, so user preference

#

probably r15

topaz valley
#

what kind of fling exactly you tryna achieve here

#

like out of the map?

#

or small distance fling

#

@mossy mountain?

mossy mountain
#

sec

#

brb

#

@topaz valley give me 6 minutes

neon zenith
topaz valley
mossy mountain
#

back

#

it's an annoying fling, not out of the map, but one that makes you stay ragdolled for a few seconds

#

bathroom break

topaz valley
#

or less flingy

#

or more

mossy mountain
#

back

#

can i try it in my game

#

in yours the gui overlaps and i can't quite see it

topaz valley
#

ij

mossy mountain
#

😭

topaz valley
#

cant send the script?

mossy mountain
#

oh?

#

a

topaz valley
#

bruv

mossy mountain
#

stupid thing blocking random dms

#

how do i disable it

#

i disabled it

topaz valley
#

sadge

#

do i dm

#
local function explode(player: Player)
    local flingPower = 200 -- adjust. the higher the longer distance of the fling
    local character = player.Character or player.CharacterAdded:Wait()
    if not character then
        warn("No character found for player:", player)
        return
    end

    local HRP = character:FindFirstChild("HumanoidRootPart") or character.PrimaryPart
    if not HRP then
        warn("No HumanoidRootPart or PrimaryPart found for:", player)
        return
    end

    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if humanoid then humanoid.PlatformStand = true end

    local function randomUnitVector()
        local theta = math.random() * 2 * math.pi
        local phi = math.acos(2 * math.random() - 1)
        local x = math.sin(phi) * math.cos(theta); local z = math.cos(phi)
        return Vector3.new(x, 0.2, z)
    end

    local flingDirection = randomUnitVector() * flingPower
    local bodyVelocity = Instance.new("BodyVelocity")
    bodyVelocity.Velocity = flingDirection
    bodyVelocity.MaxForce = Vector3.new(1e5, 1e5, 1e5)
    bodyVelocity.P = 1250
    bodyVelocity.Parent = HRP

    local bodyAngularVelocity = Instance.new("BodyAngularVelocity")
    bodyAngularVelocity.AngularVelocity = Vector3.new(
        math.random(-10, 10),
        math.random(-10, 10),
        math.random(-10, 10)
    ) * math.pi * 4
    bodyAngularVelocity.MaxTorque = Vector3.new(1e5, 1e5, 1e5)
    bodyAngularVelocity.P = 3000
    bodyAngularVelocity.Parent = HRP

    task.delay(1, function()
        if bodyVelocity and bodyVelocity.Parent then
            bodyVelocity:Destroy()
        end
        if bodyAngularVelocity and bodyAngularVelocity.Parent then
            bodyAngularVelocity:Destroy()
        end
        if humanoid then
            humanoid.PlatformStand = false
        end
    end)
end
#

there