I'm wanting to do something once a player zoom in (to the max) for example, the player zoomned in to first person and it will print 'hi' ONCE. and if he zoom out nothing will change until he zoom in back again.
You can achieve this effect using a combination of an input event and a distance check.
Note that this code will only work in a LocalScript, so place it somewhere a LocalScript can run.
local uis = game:GetService("UserInputService") local player = game.Players.LocalPlayer uis.InputChanged:connect(function(InputObject) if InputObject.UserInputType == Enum.UserInputType.MouseWheel then --The user is scrolling in some way, so let's check the distance between their Camera and their Head. --After some testing, the 'first person' distance is .5 studs, exactly. But, it's likely to be a bit higher or a bit lower at any point, so it's better to check if it's less than slightly higher than .5. --Because fractional studs are so small, < .6 should work: if (player.Character.Head.CFrame.p - workspace.CurrentCamera.CFrame.p).magnitude < .6 then print("First person achieved!") end end end)
The above code isn't perfect (it will print when you zoom out as well as in, and will continue to print if you 'zoom in' while already in first person), but should be a good starting point.
Given that I know you're new to ROBLOX scripting, take a look at wiki.roblox.com, and the Object Browser in Studio, to see the API you have available.