Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Any Help with my camera mode script?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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)

0
YES!! THANKS SO MUCH MAN xShadowNight 20 — 8y
Ad

Answer this question