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

Any Help with my camera mode script?

i'm trying to make my tool go into first person mode on equip, and when i unequip it goes back to third person mode. Now this works but the problem is that every time the player dies hes stuck in 1st person. Help?

local p= game.Players.LocalPlayer
local tool= script.Parent
function equipped()
wait()
p.CameraMode= 1
end
function unequipped()
wait()
p.CameraMode= 0
end
tool.Equipped:connect(equipped)
tool.Unequipped:connect(unequipped)

1 answer

✓ Accepted answer

This should do it:

local p= game.Players.LocalPlayer
local tool= script.Parent

p.Character.Humanoid.Died:connect(function()
	p.CameraMode= 0
end)

function equipped()
	wait()
	p.CameraMode= 1
end

function unequipped()
	wait()
	p.CameraMode= 0
end

tool.Equipped:connect(equipped)
tool.Unequipped:connect(unequipped)

1 comment

0

YES!! THANKS SO MUCH MAN

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