#developer product
1 messages · Page 1 of 1 (latest)
--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
it has something to do with player.CharacterAdded:Wait() prob
hmm
@mossy mountaini removed the player.CharacterAdded:Wait() and it worked
** You are now Level 2! **
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
thank you
much simplier approach would be:
if not player.Character then
player.CharacterAdded:Wait() -- much better
end
lemme know if it worked
it did
but my other functions (besides explode) didn't
mind helping with those too?
what was it ayways
wat da error?
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
like the fling is not flinging or flinging the incorrect way? or u wanted a better fling system
it is flinging but it feels like a ripoff
when flinging mid-jump it just spins you too
what kind of fling exactly you tryna achieve here
like out of the map?
or small distance fling
@mossy mountain?
or just local character = player.Character or player.CharacterAdded:Wait()
i mean like his not defining the character or will use the variable so its better to just remove it
back
it's an annoying fling, not out of the map, but one that makes you stay ragdolled for a few seconds
bathroom break
back
can i try it in my game
in yours the gui overlaps and i can't quite see it
😭
cant send the script?
bruv
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