#Remote event not firing, but instead a different one fired

1 messages · Page 1 of 1 (latest)

scarlet granite
#

Im not sure how to fix this, but i have a troll script, and one of the gamepasses is to kill, and fling, except killing keeps firing even when i press on "flinging" is the problem gamepass id's? or the remove evnts themselves not sure, but the gamepass id are both different.

crisp trellis
#

whats the code

scarlet granite
#
local marketplace = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
local product = 3248561623

script.Parent.MouseButton1Down:Connect(function()    
    marketplace:PromptProductPurchase(game.Players.LocalPlayer, product)
end)

local success, errormessage = pcall(function()
    marketplace.PromptProductPurchaseFinished:Connect(function(plr, product, isPurchased)
        if isPurchased == true then
            game.ReplicatedStorage.Flingall:FireServer()
        end
    end)
end)
game.ReplicatedStorage.Flingall.OnServerEvent:Connect(function(plr)
    local HRP = plr.Character:FindFirstChild("HumanoidRootPart") 
    local Humanoid = plr.Character:FindFirstChild("Humanoid") 
    Humanoid.Sit = true
    local BodyVelocity = Instance.new("BodyVelocity", HRP) 
    BodyVelocity.Velocity = Vector3.new(234,200,345) 
    wait(1)
    BodyVelocity:Destroy()
end)

game.ReplicatedStorage.Killone.OnServerEvent:Connect(function(plr, name)
    local playerkilled = game.Players:FindFirstChild(name)
    playerkilled.Character.Humanoid.Health = 0
end)
scarlet granite
crisp trellis
#

so Killone is firing when you buy Flingall

#

right?

scarlet granite
#

no the opposite

crisp trellis
#

you buy kill and it flings?

#

whats the fling product ID and the kill product ID

scarlet granite
#

Yea, and its the case for all the other gamepasses but i didnt include them becuase chat limit

scarlet granite
crisp trellis
#

no matter what, if its purchased, it flings

scarlet granite
#

yeah

crisp trellis
#

add

if product == 123 then
  --do that products event  
elseif product == 321 then
  --do that products event
--so on
#

inside ifpurchased == true

#

also == true is redundant

#

since a boolean can just be itself

#

@scarlet granite not sure if i pinged you with the solution to it

#
local success, errormessage = pcall(function()
    marketplace.PromptProductPurchaseFinished:Connect(function(plr, product, isPurchased)
        if isPurchased == true then
            if product == 3248561623 then
              game.ReplicatedStorage.Flingall:FireServer()
            elseif product == 3248561725 then  
              game.ReplicatedStorage.Killone:FireServer("name")
            end
        end
    end)
end)
scarlet granite