Im making a game where you can buy 3d printers, make things and sell them.
Right now, im stuck trying to make a system where a frame shows the printers you own.
When you buy a printer, there is a button that says “BUY” next to the type of printer. The one i have now costs 0 dollars (because its the beginner one) to clarify any confusion.
The way i want this to work is that every time you buy a new printer (which you can only have one of each type) it stacks on a scrolling gui. Example shown below
My shop (planning to add more of course) :
My shop script:
script.Parent.MouseButton1Click:Connect(function(click)
local plr = game.Players.LocalPlayer
if plr then
local Money = plr.leaderstats.Cash
if Money and Money.Value >= 0 then
Money.Value -= 0
for i,part in pairs(game.Workspace.RealtecBasic:GetChildren()) do
part.Transparency = 0
part.CanCollide = true
game.Workspace.RealtecBasicNozzle.image.Decal.Transparency = 0
end
for i,part in pairs(game.Workspace.RealtecBasicNozzle:GetChildren()) do
part.Transparency = 0
part.CanCollide = true
game.Workspace.RealtecBasicNozzle.image.Decal.Transparency = 0
end
if Money and Money.Value >= 0 then
script.Parent.Text = "Purchased!"
script.Parent.BackgroundColor3 = Color3.new(0.243137, 0.243137, 0.243137)
script.Parent.TextColor3 = Color3.new(1, 1, 1)
script.Parent.Sound:Play()
local tweenService = game:GetService("TweenService") -- ignore tweenservice
local object = script.Parent
local tweenInfo = TweenInfo.new(
2,
Enum.EasingStyle.Quad,
Enum.EasingDirection.Out,
math.huge,
true,
0.5
)
local properties = {
BackgroundTransparency = 0.8
}
local tween = tweenService:Create(object, tweenInfo, properties)
tween:Play() -- end of tweenservice
if script.Parent.Text == "Purchased!" then
script.Parent.Interactable = false
end
end
end
end
end)
Thanks, and let me know if i missed anything