Click on part to teleport player to position

image

Try replacing your function for the camera with this:

local debounce = true;
function camera()
	if debounce then
		cam.CFrame = camPart.CFrame * CFrame.Angles(
			math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
			math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
			0
		)
	else
		game:GetService("RunService").RenderStepped:Disconnect(camera);
		debounce = true;
	end
end
game:GetService("RunService").RenderStepped:Connect(camera);

and adding debounce = false to the start of the function I gave you earlier (client-side). If you want to rerun the camera script with this setup, you’ll, of course, have to reconnect the function.


like that==?

You’d want to put “debounce = false” inside of the function, so after the line game.ReplicatedStorage.CameraEvent.OnClientEvent:Connect(function().

Also, on the line after the else statement, “Disconnect” is spelled as “Disonnect”. I fixed the spelling in my original post, you should be able to just copy it over and replace it agiaan.

okgodosufiuihfoidhwa IT WORKSSSSS TYSM

1 Like