Problem with timer.Create


function sleep(ply)
ply:StripWeapons()
ply:CreateRagdoll()
ply:Spectate( OBS_MODE_CHASE )
ply:SpectateEntity( ply:GetRagdollEntity() )
end

timer.Create("sleeptimer",5,1,sleep, ply)

Error: ply ni value (when ply:StripWeapons())

[lua]local function sleep(ply)
ply:StripWeapons()
ply:CreateRagdoll()
ply:Spectate(OBS_MODE_CHASE)
ply:SpectateEntity(ply:GetRagdollEntity())
end
timer.Create(“sleeptimer”, 5, 1, function() sleep(player_entity) end)[/lua]

I don’t know if you can spectate the ragdoll of a player but player_entity must be a valid player provided by you.