Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I want the tools not to be seen when I zoom in, how can I do it?

So I'm trying to create a zoom-in when you right click, I have done to check if the tools are equipped so that when it equipped and the player clicked right click, it'll zoom in, the problem is, I want it not to see the tools, can someone help me how can I do it?

2 answers

✓ Accepted answer

In order to make the tool invisible for the Player, you can set the LocalTransparencyModifier property of the tool's handle to 1.

Example:

local zoomBool = false
tool.Activated:Connect(function()
    zoomBool = not zoomBool
    zoomCamera(zoomBool) --your zoom function/code here
    tool.Handle.LocalTransparencyModifier = zoomBool and 1 or 0
end)

tool.Unequipped:Connect(function()
    zoomBool = false
    tool.Handle.LocalTransparencyModifier = 0
end)

1 comment

0

A good thing I've solved it before, but thanks for it, it's also working.

local tool = script.Parent
local camera = game.Workspace.CurrentCamera

function CHECK_ISFP()
	if (camera.focus.p - camera.CoordinateFrame.p).magnitude <= 1 then
		print("First person")
		return true -- returns 'true'

	elseif (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then 
		print("Third person")
		return false -- returns 'false'
	end
end

function HIDE_TOOL()
	if CHECK_ISFP() then -- if 'true' then 
		tool.Handle.LocalTransparencyModifier = 1

	elseif not CHECK_ISFP() then -- if 'false' then 
		tool.Handle.LocalTransparencyModifer = 0
	end
end

camera.Changed:connect(HIDE_TOOL)

This discussion is preserved as it was. New answers, comments, and votes are closed.