Im trying to make this touched function that changes the player cameratype to "Watch" Can somebody help me?
function cam(part) if part.Parent:findFirstChild("Humanoid") then print("Works") camclone = game.Workspace.CurrentCamera:clone() camclone.Parent = (part.Parent.Backpack) camclone.CameraType = "Watch" end end script.Parent.Touched:connect(cam)
You can only access the player's camera via LocalScripts, try this:
--LocalScript in backpack perhaps local player = game.Players.LocalPlayer local character = player.Character local camera = Workspace.CurrentCamera camera.CameraType = "Custom" -- Need to reset the camera every time the player respawns. character["Left Leg"].Touched:connect(function(obj) if obj == Workspace.Part then -- whatever you need to touch camera.CameraType = "Watch" end end)