the error: attempt to concatenate nil with string
this script is to advertise player’s game by text but in line 24 it occurs the error
script:
local box = script.Parent
local gameImg = box.Parent:WaitForChild("GameImage")
local advertisebtn = box.Parent:WaitForChild("Advertise")
local mps = game:GetService("MarketplaceService")
local adtext = box.Parent.Parent:WaitForChild("AdvertisementText")
local plr = game.Players.LocalPlayer
productID = 1878843532
box.FocusLost:Connect(function(EP, ifl)
if EP then
local id = tonumber(box.Text)
if id then
local gameInfo = game:GetService("MarketplaceService"):GetProductInfo(id)
if gameInfo then
gameImg.Image = "rbxassetid://" .. gameInfo.IconImageAssetId
box.Text = "Game Detected !"
wait(1)
box.Text = ""
wait(0.1)
advertisebtn.MouseButton1Click:Connect(function()
local gameId = tonumber(box.Text)
mps:PromptProductPurchase(game.Players.LocalPlayer, productID)
adtext.Text = "Join"..gameInfo.Value .."Made By ".. plr.Name
end)
end
end
end
end)