Hello I have This Error MarketplaceService:PromptProductPurchase() player should be of type Player, but is of type nil. I Looked On The Roblox Dev Hub About it And It Is exactly the same code i wrote. Please Leave A Response Its On Line 30
local sirens = game.Workspace.Map.Area47.Siren.Siren2
local Log = script.Parent.YN
local start = script.Parent.Start
local stop = script.Parent.Stop
local stress = game.StarterGui.SeverStress.TextLabel.Value
local MPS = game:GetService("MarketplaceService")
local AirStrikeID = 1082388187
local Players = game:GetService("Players")
local sirenson = false
local Player = Players.LocalPlayer
-- bruv
start.ClickDetector.MouseClick:Connect(function()
if stress.Value < 90 then
workspace.bombboi.Launching.Value = "N"
sirenson = false
Log.SurfaceGui.TextLabel.TextColor3 = Color3.new(1, 0, 0)
Log.SurfaceGui.TextLabel.Text = "ERR:STRESS_NOT_ABOVE_90%"
wait(2)
Log.SurfaceGui.TextLabel.Text = ""
Log.SurfaceGui.TextLabel.TextColor3 = Color3.new(1, 1, 1)
else
sirens.Sirens.Playing = true
sirens.Sirens.Volume = 10
sirenson = true
Log.SurfaceGui.TextLabel.Text = "Sirens Launched Would You Like To Purchase A Air Strike?"
wait(1)
MPS:PromptProductPurchase(Player,AirStrikeID)
if Enum.ProductPurchaseDecision.PurchaseGranted then
workspace.bombboi.Launching.Value = "Y"
else
Log.SurfaceGui.TextLabel.TextColor3 = Color3.new(1, 0, 0)
Log.SurfaceGui.TextLabel.Text = "ERR:AIR_STRIKE_NOT_PURCHASED"
wait(2)
Log.SurfaceGui.TextLabel.TextColor3 = Color3.new(1, 1, 1)
Log.SurfaceGui.TextLabel.Text = ""
end
end
end)
Please Leave You Suggestion In The Comments !
