#Remote event not firing, but instead a different one fired
1 messages · Page 1 of 1 (latest)
whats the code
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)
.
no the opposite
Yea, and its the case for all the other gamepasses but i didnt include them becuase chat limit
kill: 3248561725 fling:3248561623
youre not doing anything with product
no matter what, if its purchased, it flings
yeah
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)
Thanks! just tried this and it worked