I am very confused about this,
Is using this script to create ‘‘UGC’’ events a good thing?
I don’t know where to start how to make a free ugc script,
I only have this script to create, Free UGC Event
Script Code:
local UGCID = 000001
local player = game:GetService("Players").LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats then
local Level = leaderstats:FindFirstChild("Level")
if Level and Level.Value > 1 then
game:GetService("MarketplaceService"):PromptPurchase(player, UGCID)
end
end
end)
will that script work, for UGC event in my game???
What the Script is doing is that it’s basically checking that when the Parent of it has been clicked (this could be a GUI or anything that has a button). When it senses that it’s been checked, it will find the leaderstats folder inside the player (Keep in mind that this is not a player model inside workspace). It then looks for a value called “Level” inside the leaderstats. If the value of level is more than 1, it will prompt a purchase to that player with the UGC in it.