Hello There! i’m a new programmer and i really need help with VIP Tool Gamepass inside of a tool shop that i made, the issue is the GUI TextButton “Buy” based on the value of “ItemName,ItemPrice” and these are “StringValue,IntValue” inside of parts in the MainShop
and i want to, when it comes to the VIP Tool when u click on the TextButton “Buy” it shows buy gamepass message.
Here's a Screen Shot
Here’s the Button and the Value
Note
: this is screen shot in studio not ingame and i typed those values aka “Price, Eggs”
Here's the buy script
this script run for Each tool not only the VIP one
local serverscriptService = game:GetService("ServerScriptService")
local replicatedStorage = game:GetService("ReplicatedStorage")
local workSpace = game:GetService("Workspace")
local Settings = require(serverscriptService:WaitForChild("SettingSS"))
local DataStore = game:GetService("DataStoreService")
replicatedStorage:WaitForChild("ShopBuyA").OnServerEvent:Connect(function(player,page)
local char = player.Character
local shop = workSpace:WaitForChild("ToolShop")
local currency = player:WaitForChild("leaderstats"):WaitForChild(Settings.Currency)
if currency.Value >= shop:WaitForChild("Parts"):WaitForChild("Tool"..page):WaitForChild("ItemPrice").Value then
player:WaitForChild("ToolSave"):WaitForChild("Tool"..page).Value = true
for i,v in pairs(workSpace:WaitForChild("ToolShop"):WaitForChild("Parts"):GetChildren()) do
local data = DataStore:GetDataStore(v.Name)
local toolsave = player:WaitForChild("ToolSave"):WaitForChild(v.Name)
data:SetAsync(player.UserId, toolsave.Value)
end
currency.Value = currency.Value - shop:WaitForChild("Parts"):WaitForChild("Tool"..page):WaitForChild("ItemPrice").Value
end
end)
Note
: i already have the gamepass_id and i know how to make a gui Button gamepass, but idk how to make one inside of shop, and dont worry about equip/unequip cuz i already have script for this.
regards
xStaRz2