here is my script:
local ts = game:GetService("TweenService")
local cam = game.Workspace.CurrentCamera
local oof = true
script.Parent.MouseButton1Click:Connect(function()
if game.Workspace.CurrentCamera.CFrame ~= game.Workspace.BluePart.Position and oof ~= false then
script.Parent.Parent["Buy thing"].Text = "Buy Crystal For 1,000,000 Poo"
local ti = TweenInfo.new(2,Enum.EasingStyle.Quint,Enum.EasingDirection.Out)
local tablething = {CFrame = game.Workspace.RedPart.CFrame}
local tween = ts:Create(cam,ti,tablething)
tween:Play()
end
end)
script.Parent.MouseButton1Click:Connect(function()
if game.Workspace.CurrentCamera.CFrame ~= game.Workspace.GreenPart.Position then
oof =false
script.Parent.Parent["Buy thing"].Text = "Buy Crystal For 25,000 Poo"
local ti = TweenInfo.new(2,Enum.EasingStyle.Quint,Enum.EasingDirection.Out)
local tablething = {CFrame = game.Workspace.BluePart.CFrame}
local tween = ts:Create(cam,ti,tablething)
tween:Play()
oof =false
end
end)

2 comments
why do you have a cam variable then proceed to use game.Workspace.CurrentCamera in every instance
becuase i want to