Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

MarketPlaceService along with dialogs not working correctly?

Asked by 9 years ago

I feel a bit dumb for asking this, as I am pretty advanced in scripting in lua.. It's just as I been playing Minecraft coding in Java I completely just went dead, any help?

--// Weapons

-- Not using the strings used for the ID's

local Glock17 = 30474685
local M14 = 30474688
local M24 = 30474675
local M4A1 = 30474667
local Peacekeeper = 30474695

--// Services needed

-- Not using the string used for the service

local MarketPlaceService = game:GetService("MarketPlaceService")

--// Script, do not edit anything below this line

script.Parent.DialogChoiceSelected:connect(function(Player, Weapon)
    if (Weapon == script.Parent.Glock17) then
        game:GetService("MarketPlaceService"):PromptPurchase(Player, 30474685)


    end
end)
0
Shouldn't line 20 be "if (Weapon == Glock17) then"? ISellCows 2 — 9y
0
Well, Glock17 is the ID, and I just put that there to keep notes. lxcalhost 0 — 9y
0
Weapon == script.Parent.Glock17 asked the script if Weapon is exactly the same instance as script.Parent.Glock17, not if they are identical, but rather if they are the same thing Validark 1580 — 9y
0
I'm confused, honestly... lxcalhost 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago
--// Weapons

-- Not using the strings used for the ID's

local Glock17 = 30474685
local M14 = 30474688
local M24 = 30474675
local M4A1 = 30474667
local Peacekeeper = 30474695

--// Services needed

-- Not using the string used for the service

local MarketPlaceService = game:GetService("MarketPlaceService")

--// Script, do not edit anything below this line

script.Parent.DialogChoiceSelected:connect(function(Player, Weapon)
    if (Weapon == "Glock17" then
        game:GetService("MarketPlaceService"):PromptPurchase(Player, 30474685)


    end
end)

I think this should work; enjoy :)

Ad

Answer this question