Dont know how to explain just help surface gui problem

what i want: if the textbutton transparency is 1 the camera will go where i want it to go

script one: aka the one that makes the cam where i want it to be if textbutton transparency = 1

	local textbutton = script.Parent
if textbutton.Transparency == 1 then
wait(2)	
print("Working")
local TweenService = game:GetService('TweenService')
local cam = workspace.CurrentCamera

local function TweenBetweenParts(one, two)
	local tween = TweenService:Create(cam, TweenInfo.new(), {CFrame = two.CFrame})
	cam.CFrame = one.CFrame
	tween:Play()
end

	TweenBetweenParts(workspace.part1, workspace.part2)
	end

script two: aka the one that turns the textbutton transparency to 1

local textbutton = script.Parent
local Uistroke =  textbutton:FindFirstChild("UIStroke")
local uicorner = textbutton:FindFirstChild("UICorner")

textbutton.MouseButton1Click:Connect(function()
	for count = 1, 10 do
		textbutton.Transparency = count / 10
		wait(0.1)
		Uistroke:Destroy()
		uicorner:Destroy()
	

	end


end)

script 3: dont really need help with this

local PlayerModule = require(game:GetService('Players').LocalPlayer.PlayerScripts:WaitForChild('PlayerModule'))
local controls = PlayerModule:GetControls()

controls:Disable()



local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = workspace.part1.CFrame


picture of how it looks:

Screenshot (74)

Try using localscripts for GUI elements instead of server sided scripts.

2 Likes