Player Point Script? [Unsolved]
How would you change this script, so if you buy the Dev Product you get a Darkheart or Illumina?
001 | local plr = script.Parent.Parent.Parent |
002 | local link = game:GetService( "MarketplaceService" ) |
006 | local function create(instanc) |
007 | return function (object) |
008 | local button = Instance.new(instanc) |
009 | for i,v in pairs (object) do |
019 | repeat wait() until plr:findFirstChild( "leaderstats" ) |
020 | local stat = plr.leaderstats [ statn ] |
025 | { id = 19793144 , points = 0 , cost = 1 , nam = "Add 100 Player Points" } ; |
026 | { id = 19740656 , points = 0 , cost = 1 , nam = "Add Player Points" } ; |
027 | { id = 19740656 , points = 0 , cost = 1 , nam = "Add Player Points" } ; |
032 | local main = create( "Frame" ) |
034 | Size = UDim 2. new( 0 , 250 , 0 , 0 ); |
035 | BackgroundTransparency = 1 ; |
037 | Position = UDim 2. new( 0 ,- 250 ,. 5 ,- 165 ); |
039 | Parent = script.Parent |
042 | local folder = create( "Frame" ) |
044 | Size = UDim 2. new( 0 , 200 , 0 , 300 ); |
045 | BackgroundColor = BrickColor.new( "Really black" ); |
046 | BackgroundTransparency = . 3 ; |
053 | local header = create( "Frame" ) |
055 | Size = UDim 2. new(. 5 , 0 , 0 , 20 ); |
056 | Position = UDim 2. new( 1 , 0 , 0 , 0 ); |
058 | BackgroundTransparency = 1 ; |
063 | local Tbutton = create( "TextButton" ) |
065 | Size = UDim 2. new( 0 , 20 , 0 , 20 ); |
066 | Position = UDim 2. new( 1 , 3 , 0 , 0 ); |
067 | BackgroundTransparency = . 25 ; |
068 | BackgroundColor = BrickColor.new( "Really black" ); |
072 | TextColor = BrickColor.White(); |
077 | local label = create( "TextLabel" ) |
080 | Size = UDim 2. new( 1 , 0 , 0 , 20 ); |
081 | BackgroundTransparency = . 25 ; |
082 | BackgroundColor = BrickColor.new( "Really black" ); |
085 | TextColor = BrickColor.White(); |
092 | local watermark = create( "TextLabel" ) |
094 | Size = UDim 2. new( 0 , 0 , 0 , 0 ); |
095 | Position = UDim 2. new( 1 , 0 , 1 , 0 ); |
096 | TextXAlignment = "Right" ; |
097 | TextYAlignment = "Bottom" ; |
098 | BackgroundTransparency = 1 ; |
100 | TextColor = BrickColor.new( "Institutional white" ); |
104 | TextTransparency = . 9 ; |
109 | local function buyItem(button) |
110 | button.MouseButton 1 Click:connect( function () |
111 | local marketId = button [ "market" ] .Value |
112 | local pointsToAward = button [ "points" ] .Value |
113 | link:PromptProductPurchase(plr,marketId) |
114 | link.ProcessReceipt = function (receiptInfo) |
115 | if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId = = plr.userId then |
116 | stat.Value = stat.Value + pointsToAward |
122 | for i,v in ipairs (conversions) do |
123 | local button = create( "TextButton" ) |
126 | Size = UDim 2. new( 1 , 0 , 0 ,y); |
127 | BackgroundColor = BrickColor.Black(); |
128 | TextColor = BrickColor.White(); |
129 | TextXAlignment = "Left" ; |
131 | Position = UDim 2. new( 0 , 0 , 0 ,((i*y)+ 2 )-(y+ 2 )); |
140 | local cost = create( "TextLabel" ) |
143 | Size = UDim 2. new( 0 , 0 , 1 , 0 ); |
144 | BackgroundColor = BrickColor.Black(); |
145 | TextXAlignment = "Right" ; |
147 | Position = UDim 2. new( 1 , 0 , 0 , 0 ); |
149 | TextColor 3 = Color 3. new( 20 / 255 , 166 / 255 , 0 / 255 ); |
156 | local buyTag = create( "IntValue" ) |
165 | local pointsTag = create( "IntValue" ) |
180 | Tbutton.MouseButton 1 Click:connect( function () |
181 | if Tbutton.Text = = ">>" then |
182 | gui:TweenPosition(UDim 2. new( 0 , 0 ,. 5 ,- 165 ), "Out" , "Back" , true ,. 5 ) |
183 | header:TweenPosition(header.Position - UDim 2. new( 0 , 45 , 0 , 0 ), "In" , "Quad" , true ) |
186 | gui:TweenPosition(UDim 2. new( 0 ,- 250 ,. 5 ,- 165 ), "Out" , "Quad" , true ,. 5 ) |
187 | header:TweenPosition(UDim 2. new( 1 , 0 , 0 , 0 ), "In" , "Quad" , true ) |