I tried writing a code that detects when a player sits in a chair but It doesn’t work no sign of errors I tried using print but no print in console too can someone help me?
My code is a local script
local cam = workspace.CurrentCamera
local Seat = script.Parent.Koltuklar.Chair1.Seat
local function oturma()
if Seat.Occupant ~= nil and cam.CameraType == Enum.CameraType.Custom then
print('Biri oturdu')
cam.CameraType = Enum.CameraType.Scriptable
elseif Seat.Occupant == nil and cam.CameraType == Enum.CameraType.Scriptable then
print('Kişi şuan oturmuyor')
cam.CameraType = Enum.CameraType.Custom
end
end
cam.CameraType = Enum.CameraType.Scriptable
Seat:GetPropertyChangedSignal("Occupant"):Connect(oturma)