Hello, I am trying to mimic the Mining Simulator Shop, and I am having some issues. The Issue is, when you click the arrow to the next item, in this case it's Auras, it does that, but you can't go back, because it doesn't recognize lines 35 to 61. Help would be appreciated

function auras()
cam.CFrame = CFrame.new(-23.667, 23.018, -175.311)
wait(0.1)	
cam.CameraType = "Scriptable"
local things = gui.Parent.ShopGuiArrows.Aura
things.Value.Value = 1
if things.Value.Value == 1 then
	things.Parent.Enabled = true
	things.Right.ImageTransparency = 0
	things.Left.ImageTransparency = 1
	things.Right.MouseButton1Click:connect(function()
		print("1")
		local tween = game:GetService("TweenService")
		local cam = workspace.CurrentCamera
		local tweeninfo = TweenInfo.new(
			
			3,
			Enum.EasingStyle.Elastic,
			Enum.EasingDirection.Out,
			0,
			false,
			0
		)
		
		local move = {
			CFrame = CFrame.new(31.058, 23.018, -175.311)
		}
		
		local Tween = tween:Create(cam,tweeninfo,move)
		Tween:Play()
		things.Value.Value = 2
	end)
end

---V this block is what the script doesn't recognize V---
if things.Value.Value == 2 then
	things.Parent.Enabled = true
	things.Left.ImageTransparency = 0
	things.Left.MouseButton1Click:Connect(function()
		print("2")
		local tween = game:GetService("TweenService")
		local cam = workspace.CurrentCamera
		local tweeninfo = TweenInfo.new(
			
			3,
			Enum.EasingStyle.Elastic,
			Enum.EasingDirection.Out,
			0,
			false,
			0
		)
		
		local move = {
			CFrame = CFrame.new(-23.667, 23.018, -175.311)
		}
		
		local Tween = tween:Create(cam,tweeninfo,move)
		Tween:Play()
		things.Value.Value = 1
	end)
end
end
--------------------------------------------------------------------------

6 comments

0

Is i giving an error? If so what

0

It's not giving any output errors, so I don't know what the problem is to begin with

0

Why are you calling MouseButton1Click inside the if statement? You should be using that first, THEN checking the value of "things" to see how to proceed.

0

That only causes more problems though

0

What calls the function auras()? I'm assuming this is a local script. See if you could make a global variable outside of this function set to what you do on lines 31 and 59. At the same time add a print after the tween plays. Dinoz suggestion should also be considered.

0

this is a global script, and there is a call for the function