Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I am trying to make a back button for my shop and i need help can you help?

Asked by 3 years ago

I am trying to make my custom shop area where you use cameras to get around the lobby and when I try to click on the shop button it goes to the shop but the back button does not come up!!! can you help me?

shop client script

local btn = script.Parent

btn.MouseButton1Click:Connect(function()
    btn.Visible = false
    btn.Parent.Title.Visible = false
    btn.Parent.PlayGui.Visible = false
    btn.FindFirstChild.Parent.ReturnShopBtn.Visible = true
end)

btn.Parent:FindFirstChild("ReturnShopBtn").MouseButton1Click:Connect(function()
    btn.Visible = true
    btn.Parent.Title.Visible = true
    btn.Parent.PlayGui.Visible = true
    btn.FindFirstChild.Parent.ReturnShopBtn.Visible = true
end)

the camera script


local camera = workspace.CurrentCamera local mainMenuMap = workspace:WaitForChild("MainMenuMap") local tweenService = game:GetService("TweenService") local btn = script.Parent function tweenCamera(pos,tweenTime) tweenService:Create(camera, TweenInfo.new(tweenTime,Enum.EasingStyle.Linear),{CFrame = pos.CFrame}):Play() end btn.MouseButton1Click:Connect(function() btn.Visible = false btn.Parent.Title.Visible = false btn.Parent.Shop.Visible = false tweenCamera(mainMenuMap.CamPart3,1) wait(1) print("reached Destnation") end)

P.s test this code out in studio make a text button on screengui

Answer this question